mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-24 23:44:56 +03:00
tests: fix various
This commit is contained in:
parent
9c7e30bab5
commit
f41cfa112e
@ -670,10 +670,6 @@
|
||||
;: weld
|
||||
:: +uno:by arm test
|
||||
::
|
||||
:: Checks with empty map (a or b)
|
||||
::
|
||||
%- expect-fail
|
||||
|. ((~(uno by m-nul) m-des) union-gate)
|
||||
%+ expect-eq
|
||||
!> m-des
|
||||
!> ((~(uno by m-des) m-nul) union-gate)
|
||||
|
@ -85,6 +85,7 @@
|
||||
=. -.peer-state
|
||||
:* symmetric-key=nec-marbud-sym
|
||||
life=5
|
||||
rift=0
|
||||
public-key=marbud-pub
|
||||
sponsor=~bud
|
||||
==
|
||||
@ -110,6 +111,7 @@
|
||||
=. -.peer-state
|
||||
:* symmetric-key=marbud-sym
|
||||
life=5
|
||||
rift=0
|
||||
public-key=marbud-pub
|
||||
sponsor=~bud
|
||||
==
|
||||
@ -121,6 +123,7 @@
|
||||
=. -.peer-state
|
||||
:* symmetric-key=bud-marbud-sym
|
||||
life=3
|
||||
rift=0
|
||||
public-key=bud-pub
|
||||
sponsor=~bud
|
||||
==
|
||||
@ -132,6 +135,7 @@
|
||||
=. -.peer-state
|
||||
:* symmetric-key=marbud2-sym
|
||||
life=5
|
||||
rift=0
|
||||
public-key=marbud-pub
|
||||
sponsor=~bud
|
||||
==
|
||||
@ -143,6 +147,7 @@
|
||||
=. -.peer-state
|
||||
:* symmetric-key=bud-marbud-sym
|
||||
life=3
|
||||
rift=0
|
||||
public-key=bud-pub
|
||||
sponsor=~bud
|
||||
==
|
||||
@ -311,112 +316,6 @@
|
||||
!> (sy ,.moves3)
|
||||
==
|
||||
::
|
||||
<<<<<<< HEAD
|
||||
++ test-comet-encounter ^- tang
|
||||
::
|
||||
=/ lane-foo=lane:ames [%| `@ux``@`%lane-foo]
|
||||
::
|
||||
=/ =open-packet:ames
|
||||
:* public-key=`@`comet-pub
|
||||
sndr=our.comet
|
||||
sndr-life=1
|
||||
rcvr=~bud
|
||||
rcvr-life=3
|
||||
==
|
||||
=/ packet
|
||||
~! ames
|
||||
(encode-open-packet:ames open-packet crypto-core.ames-state.comet)
|
||||
=/ blob (encode-packet:ames packet)
|
||||
::
|
||||
=^ moves0 bud (call bud ~[//unix] %hear lane-foo blob)
|
||||
::
|
||||
=/ =plea:ames [%g /talk [%first %post]]
|
||||
=/ =shut-packet:ames
|
||||
:* bone=1
|
||||
message-num=1
|
||||
[%& num-fragments=1 fragment-num=0 (jam plea)]
|
||||
==
|
||||
=/ =packet:ames
|
||||
%: encode-shut-packet:ames
|
||||
shut-packet
|
||||
comet-sym
|
||||
our.comet
|
||||
~bud
|
||||
sndr-life=1
|
||||
rcvr-life=3
|
||||
==
|
||||
=/ blob (encode-packet:ames packet)
|
||||
=^ moves1 bud (call bud ~[//unix] %hear lane-foo blob)
|
||||
::
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!> ~
|
||||
!> moves0
|
||||
::
|
||||
%+ expect-eq
|
||||
!> :~ :* ~[//unix] %pass /qos %d %flog %text
|
||||
"; {<our.comet>} is your neighbor"
|
||||
==
|
||||
:* ~[//unix] %pass /bone/(scot %p our.comet)/0/1
|
||||
%g %plea our.comet plea
|
||||
== ==
|
||||
!> moves1
|
||||
==
|
||||
::
|
||||
||||||| c4bc9b3428
|
||||
++ test-comet-encounter ^- tang
|
||||
::
|
||||
=/ lane-foo=lane:ames [%| `@ux``@`%lane-foo]
|
||||
::
|
||||
=/ =open-packet:ames
|
||||
:* public-key=`@`comet-pub
|
||||
sndr=our.comet
|
||||
sndr-life=1
|
||||
rcvr=~bud
|
||||
rcvr-life=3
|
||||
==
|
||||
=/ packet
|
||||
~! ames
|
||||
(encode-open-packet:ames open-packet crypto-core.ames-state.comet)
|
||||
=/ blob (encode-packet:ames packet)
|
||||
::
|
||||
=^ moves0 bud (call bud ~[//unix] %hear lane-foo blob)
|
||||
::
|
||||
=/ =plea:ames [%g /talk [%first %post]]
|
||||
=/ =shut-packet:ames
|
||||
:* bone=1
|
||||
message-num=1
|
||||
[%& num-fragments=1 fragment-num=0 (jam plea)]
|
||||
==
|
||||
=/ =packet:ames
|
||||
%: encode-shut-packet:ames
|
||||
shut-packet
|
||||
comet-sym
|
||||
our.comet
|
||||
~bud
|
||||
sndr-life=1
|
||||
rcvr-life=3
|
||||
==
|
||||
=/ blob (encode-packet:ames packet)
|
||||
=^ moves1 bud (call bud ~[//unix] %hear lane-foo blob)
|
||||
::
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!> ~
|
||||
!> moves0
|
||||
::
|
||||
%+ expect-eq
|
||||
!> :~ :* ~[//unix] %pass /qos %d %flog %text
|
||||
"; {<our.comet>} is your neighbor"
|
||||
==
|
||||
:* ~[//unix] %pass /bone/(scot %p our.comet)/1
|
||||
%g %plea our.comet plea
|
||||
== ==
|
||||
!> moves1
|
||||
==
|
||||
::
|
||||
=======
|
||||
>>>>>>> pr
|
||||
++ test-message-flow ^- tang
|
||||
:: ~nec -> %plea -> ~bud
|
||||
::
|
||||
|
@ -18,6 +18,18 @@
|
||||
=/ clay-gate (clay-raw ~nul)
|
||||
=/ fusion fusion:clay-gate
|
||||
::
|
||||
=> |%
|
||||
++ leak-to-deps
|
||||
|= =leak:fusion
|
||||
^- (set mist:fusion)
|
||||
%- sy
|
||||
|- ^- (list mist:fusion)
|
||||
%- zing
|
||||
%+ turn ~(tap in deps.leak)
|
||||
|= l=leak:fusion
|
||||
:- (pour-to-mist:fusion pour.l)
|
||||
^$(leak l)
|
||||
--
|
||||
|%
|
||||
++ test-parse-pile ^- tang
|
||||
=/ src "."
|
||||
@ -85,11 +97,10 @@
|
||||
|.
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
changes=(my [/lib/self/hoon &+hoon+source]~)
|
||||
files=(my [/lib/self/hoon &+hoon+source]~)
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
(build-file:ford /lib/self/hoon)
|
||||
::
|
||||
@ -100,29 +111,27 @@
|
||||
++ test-mar-mime ^- tang
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
changes=(my [/mar/mime/hoon &+hoon+mar-mime]~)
|
||||
files=(my [/mar/mime/hoon &+hoon+mar-mime]~)
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
=/ [res=vase nub=state:ford:fusion] (build-nave:ford %mime)
|
||||
=/ =leak:fusion leak:(~(got by sprig.nub) file+/mar/mime/hoon)
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!>(*mime)
|
||||
(slap res !,(*hoon *vale))
|
||||
::
|
||||
%+ expect-eq
|
||||
!> (~(gas in *(set [? path])) |^/mar/mime/hoon ~)
|
||||
!> dez:(~(got by files.cache.nub) /mar/mime/hoon)
|
||||
!> (~(gas in *(set mist:fusion)) vale+/mar/mime/hoon ~)
|
||||
!> (leak-to-deps leak)
|
||||
==
|
||||
::
|
||||
++ test-mar-udon ^- tang
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
^= changes
|
||||
^= files
|
||||
%- my
|
||||
:~ [/mar/udon/hoon &+hoon+mar-udon]
|
||||
[/lib/cram/hoon &+hoon+lib-cram]
|
||||
@ -130,32 +139,37 @@
|
||||
[/mar/txt-diff/hoon &+hoon+mar-txt-diff]
|
||||
==
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
=/ [res=vase nub=state:ford:fusion] (build-nave:ford %udon)
|
||||
=/ =leak:fusion leak:(~(got by sprig.nub) file+/mar/udon/hoon)
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!>(*@t)
|
||||
(slap res !,(*hoon *vale))
|
||||
::
|
||||
%+ expect-eq
|
||||
!> (~(gas in *(set [? path])) |^/mar/udon/hoon |^/lib/cram/hoon ~)
|
||||
!> dez:(~(got by files.cache.nub) /mar/udon/hoon)
|
||||
!> %- ~(gas in *(set mist:fusion))
|
||||
:~ vale+/mar/udon/hoon
|
||||
vale+/lib/cram/hoon
|
||||
file+/lib/cram/hoon
|
||||
==
|
||||
!> (leak-to-deps leak)
|
||||
==
|
||||
::
|
||||
++ test-cast-html-mime ^- tang
|
||||
=/ changes
|
||||
=/ files
|
||||
%- my
|
||||
:~ [/mar/mime/hoon &+hoon+mar-mime]
|
||||
[/mar/html/hoon &+hoon+mar-html]
|
||||
==
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
changes
|
||||
files
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
=/ [res=vase nub=state:ford:fusion] (build-cast:ford %html %mime)
|
||||
%+ expect-eq
|
||||
@ -163,18 +177,17 @@
|
||||
!> `mime`[/text/html 13 '<html></html>']
|
||||
::
|
||||
++ test-fascen ^- tang
|
||||
=/ changes
|
||||
=/ files
|
||||
%- my
|
||||
:~ [/mar/mime/hoon &+hoon+mar-mime]
|
||||
[/lib/foo/hoon &+hoon+'/% moo %mime\0a*vale:moo']
|
||||
==
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
changes
|
||||
files
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
=/ [res=vase nub=state:ford:fusion] (build-file:ford /lib/foo/hoon)
|
||||
%+ expect-eq
|
||||
@ -182,7 +195,7 @@
|
||||
!> *mime
|
||||
::
|
||||
++ test-fasbuc ^- tang
|
||||
=/ changes
|
||||
=/ files
|
||||
%- my
|
||||
:~ [/mar/mime/hoon &+hoon+mar-mime]
|
||||
[/mar/html/hoon &+hoon+mar-html]
|
||||
@ -190,11 +203,10 @@
|
||||
==
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
changes
|
||||
files
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
=/ [res=vase nub=state:ford:fusion] (build-file:ford /lib/foo/hoon)
|
||||
%+ expect-eq
|
||||
@ -204,49 +216,51 @@
|
||||
++ test-gen-hello ^- tang
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
changes=(my [/gen/hello/hoon &+hoon+gen-hello]~)
|
||||
files=(my [/gen/hello/hoon &+hoon+gen-hello]~)
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
=/ [res=vase nub=state:ford:fusion] (build-file:ford /gen/hello/hoon)
|
||||
=/ =leak:fusion leak:(~(got by sprig.nub) file+/gen/hello/hoon)
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!> noun+'hello, bob'
|
||||
(slap res (ream '(+ [*^ [%bob ~] ~])'))
|
||||
::
|
||||
%+ expect-eq
|
||||
!> (~(gas in *(set [? path])) |^/gen/hello/hoon ~)
|
||||
!> dez:(~(got by files.cache.nub) /gen/hello/hoon)
|
||||
!> (~(gas in *(set mist:fusion)) vale+/gen/hello/hoon ~)
|
||||
!> (leak-to-deps leak)
|
||||
==
|
||||
::
|
||||
++ test-lib-strandio ^- tang
|
||||
=/ ford
|
||||
%: ford:fusion
|
||||
*ankh:clay
|
||||
deletes=~
|
||||
^= changes
|
||||
^= files
|
||||
%- my
|
||||
:~ [/lib/strand/hoon &+hoon+lib-strand]
|
||||
[/lib/strandio/hoon &+hoon+lib-strandio]
|
||||
[/sur/spider/hoon &+hoon+sur-spider]
|
||||
==
|
||||
file-store=~
|
||||
*ford-cache:fusion
|
||||
*flow:fusion
|
||||
*flue:fusion
|
||||
==
|
||||
=/ [res=vase nub=state:ford:fusion] (build-file:ford /lib/strandio/hoon)
|
||||
=/ =leak:fusion leak:(~(got by sprig.nub) file+/lib/strandio/hoon)
|
||||
;: weld
|
||||
%- expect
|
||||
!>((slab %read %get-our -.res))
|
||||
::
|
||||
%+ expect-eq
|
||||
!> %- ~(gas in *(set [? path]))
|
||||
:~ [| /lib/strandio/hoon]
|
||||
[| /lib/strand/hoon]
|
||||
[| /sur/spider/hoon]
|
||||
!> %- ~(gas in *(set mist:fusion))
|
||||
:~ vale+/lib/strandio/hoon
|
||||
file+/lib/strand/hoon
|
||||
vale+/lib/strand/hoon
|
||||
file+/sur/spider/hoon
|
||||
vale+/sur/spider/hoon
|
||||
==
|
||||
!> dez:(~(got by files.cache.nub) /lib/strandio/hoon)
|
||||
!> (leak-to-deps leak)
|
||||
==
|
||||
::
|
||||
:: |utilities: helper functions for testing
|
||||
|
@ -949,7 +949,7 @@
|
||||
(render-hex-bytes 20 `@`a)
|
||||
::
|
||||
++ address-to-checksum
|
||||
|= =address
|
||||
|= a=address
|
||||
^- tape
|
||||
=/ hexed (render-hex-bytes 20 `@`a)
|
||||
=/ hash (keccak-256:keccak:crypto (as-octs:mimes:html (crip hexed)))
|
||||
|
Loading…
Reference in New Issue
Block a user