urbit/tests/sys/hoon/hashes.hoon

57 lines
1023 B
Plaintext
Raw Normal View History

2019-01-08 05:36:15 +03:00
/+ *test
|%
++ test-muk
;: weld
%+ expect-eq
!> 0xfaf6.cdb3
!> (muk 1.234 13 'Hello, world!')
::
%+ expect-eq
!> 0xbf50.5788
!> (muk 4.321 13 'Hello, world!')
::
%+ expect-eq
!> 0xf2c.c00b
!> (muk 1.234 0 0)
::
%+ expect-eq
!> 0x8905.ac28
!> (muk 1.234 28 (crip (reap 28 'x')))
::
%+ expect-eq
!> 0x566f.7173
!> (muk 0xcafe.babe 16 (dec (bex 128)))
==
::
2019-01-01 01:42:44 +03:00
++ test-mur
2019-01-08 05:36:15 +03:00
;: weld
%+ expect-eq
!> 0x4d44.1035
2019-01-01 01:42:44 +03:00
!> (mur 'Hello, world!')
2019-01-08 05:36:15 +03:00
::
%+ expect-eq
!> 0x79ff.04e8
2019-01-01 01:42:44 +03:00
!> (mur 0)
2019-01-08 05:36:15 +03:00
::
%+ expect-eq
!> 0x64df.da5c
2019-01-01 01:42:44 +03:00
!> (mur (crip (reap 28 'x')))
2019-01-08 05:36:15 +03:00
::
%+ expect-eq
!> 0x389c.a03a
2019-01-01 01:42:44 +03:00
!> (mur [0 0])
2019-01-08 05:36:15 +03:00
::
%+ expect-eq
!> 0x389c.a03a
2019-01-01 01:42:44 +03:00
!> (mur [1 1])
2019-01-08 05:36:15 +03:00
::
%+ expect-eq
!> 0x5258.a6c0
2019-01-01 01:42:44 +03:00
!> (mur [0 (bex 32)])
2019-01-08 05:36:15 +03:00
::
%+ expect-eq
!> 0x2ad3.9968
2019-01-01 01:42:44 +03:00
!> (mur [(dec (bex 128)) 1])
2019-01-08 05:36:15 +03:00
==
--