shrub/pkg/arvo/tests/sys/vane/ford.hoon

7067 lines
182 KiB
Plaintext
Raw Normal View History

/+ *test, *test-ford
2018-07-20 02:49:11 +03:00
::
|%
2018-08-23 08:39:10 +03:00
++ test-tear ^- tang
2018-07-20 02:49:11 +03:00
::
;: welp
%+ expect-eq
!> ~['a' 'bc' 'de']
!> (tear:ford-gate 'a-bc-de')
2018-07-20 02:49:11 +03:00
::
%+ expect-eq
!> ~['abc']
!> (tear:ford-gate 'abc')
2018-07-20 02:49:11 +03:00
::
%+ expect-eq
!> ~['ab/c']
!> (tear:ford-gate 'ab/c')
2018-07-20 02:49:11 +03:00
==
::
2018-08-23 08:39:10 +03:00
++ test-unify-jugs ^- tang
2018-07-20 02:49:11 +03:00
::
%+ expect-eq
!> ^- (jug @tas @ud)
(my ~[[%a (sy 1 2 ~)] [%b (sy 3 4 5 6 ~)] [%c (sy 7 8 ~)]])
!> %+ unify-jugs:ford-gate
`(jug @tas @ud)`(my ~[[%a (sy 1 2 ~)] [%b (sy 3 4 ~)]])
`(jug @tas @ud)`(my ~[[%b (sy 5 6 ~)] [%c (sy 7 8 ~)]])
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-resource-wire-encoding ^- tang
2018-07-20 02:49:11 +03:00
::
;: welp
%+ expect-eq
!> /cx/~nul/desk/~1234.5.6/bar/foo
!> ^- path
%- scry-request-to-path:ford-gate
[%c care=%x [[~nul %desk [%da ~1234.5.6]] /foo/bar]]
::
%+ expect-eq
!> [%c care=%x [[~nul %desk [%da ~1234.5.6]] /foo/bar]]
!> %- need
(path-to-scry-request:ford-gate /cx/~nul/desk/~1234.5.6/bar/foo)
2018-07-20 02:49:11 +03:00
==
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"!. |=(a=@ud +(a))"
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
::
%+ expect-eq
!> :- [1 19]
:- ~
:_ [[1 19] ""]
^- scaffold:ford-gate
:* source-rail=[[~nul %desk] /bar/foo]
zuse-version=%309
structures=~
libraries=~
cranes=~
^= sources
:~ :* %dbug [/~nul/desk/~1234.5.6/foo/bar [[1 1] [1 19]]]
(ream '!. |=(a=@ud +(a))')
== == ==
!> parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-sur-libk ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/- struct, face=other
/+ library, *thing
!.
|=(a a)
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~[[`%struct %struct] [`%face %other]]
libraries=~[[`%library %library] [~ %thing]]
cranes=~
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [3 1] [4 8]]
(ream '|=(a a)')
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-zuse-version ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/? 400
!.
|=(a a)
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=400
structures=~
libraries=~
cranes=~
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [3 8]]
(ream '|=(a a)')
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fssg ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/~ !. [a=1 b=3]
!.
|=(a b)
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fssg
%dbug
[/~nul/desk/~1234.5.6/foo/bar [1 5] [1 18]]
(ream '[a=1 b=3]')
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [3 8]]
(ream '|=(a b)')
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fsbc ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/$ !. |=(a a)
!.
|=(a b)
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsbc
%dbug
[/~nul/desk/~1234.5.6/foo/bar [1 5] [1 16]]
(ream '|=(a a)')
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [3 8]]
(ream '|=(a b)')
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fsbr ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/| /~ ~
/~ ~
==
5
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsbr
:~ :* %fssg %dbug
[/~nul/desk/~1234.5.6/foo/bar [1 9] [1 10]]
[%bust %null]
==
:* %fssg %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 9] [2 10]]
[%bust %null]
== == == ==
^= sources
:~ [%dbug [/~nul/desk/~1234.5.6/foo/bar [4 1] [4 2]] [%sand %ud 5]]
== ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fsts ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/= a /~ ~
5
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsts %a
%fssg %dbug [/~nul/desk/~1234.5.6/foo/bar [1 12] [1 13]]
[%bust %null]
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [2 2]] [%sand %ud 5]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fsdt ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/. /~ !. a=5
/~ !. b=6
==
5
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsdt
:~ :* %fssg %dbug
[/~nul/desk/~1234.5.6/foo/bar [1 9] [1 16]]
(ream 'a=5')
==
:* %fssg %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 9] [2 16]]
(ream 'b=6')
== == == ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [4 1] [4 2]] [%sand %ud 5]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fscm ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/,
/path/to/a
/~ !. a=5
::
/path/to/b
/~ !. b=6
==
1
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fscm
:~ :- /path/to/a
:* %fssg %dbug
[/~nul/desk/~1234.5.6/foo/bar [3 7] [3 14]]
(ream 'a=5')
==
:- /path/to/b
:* %fssg %dbug
[/~nul/desk/~1234.5.6/foo/bar [6 7] [6 14]]
(ream 'b=6')
== == == ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [8 1] [8 2]] [%sand %ud 1]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fspm ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/= data /& mark /~ !. a=1
1
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsts %data
%fspm [%mark ~]
%fssg %dbug
[/~nul/desk/~1234.5.6/foo/bar [1 25] [1 32]]
(ream 'a=1')
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [2 2]] [%sand %ud 1]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fscb ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/_ /mark/
8
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fscb %fszy %mark
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [2 2]] [%sand %ud 8]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fssm ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/= data
/; !. |=(a=@u +(a))
/~ !. 5
7
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsts %data
%fssm
:* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 7] [2 24]]
(ream '|=(a=@u +(a))')
==
%fssg
:* %dbug
[/~nul/desk/~1234.5.6/foo/bar [3 7] [3 12]]
(ream '5')
== == ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [4 1] [4 2]] [%sand %ud 7]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fscl ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/= tests
/: /===/tests
/_ /mark/
3
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsts %tests
%fscl [[~ ~[~ ~ ~ [~ [%sand %tas 495.874.958.708]]]] ~]
%fscb %fszy %mark
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [4 1] [4 2]] [%sand %ud 3]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fskt ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/= data
2018-08-23 08:39:10 +03:00
/^ (list @ud)
/. /~ 1
/~ 2
2018-07-20 02:49:11 +03:00
==
6
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsts %data
%fskt
:* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 7] [2 17]]
%make
:+ %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 8] [2 12]]
[%wing ~[%list]]
:~ :+ %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 13] [2 16]]
[%base [%atom %ud]]
==
==
%fsdt
:~ :- %fssg
:+ %dbug
[/~nul/desk/~1234.5.6/foo/bar [3 11] [3 12]]
[%sand %ud 1]
::
:- %fssg
:+ %dbug
[/~nul/desk/~1234.5.6/foo/bar [4 11] [4 12]]
[%sand %ud 2]
== == ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [6 1] [6 2]] [%sand %ud 6]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fszp ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/= data /!mark/
2
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsts %data
%fszp %mark
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [2 2]] [%sand %ud 2]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-parse-scaffold-crane-fszy ^- tang
2018-07-20 02:49:11 +03:00
::
=/ parsed
%+ (full (parse-scaffold:ford-gate [[~nul %desk %da ~1234.5.6] /bar/foo]))
[1 1]
"""
/= data /mark/
9
"""
?~ q.parsed
[%leaf "failed to parse at {<p.parsed>}"]~
%+ expect-eq
!> :* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
^= crane
:~ :* %fsts %data
%fszy %mark
== ==
^= sources
:~ :* %dbug
[/~nul/desk/~1234.5.6/foo/bar [2 1] [2 2]] [%sand %ud 9]
== == ==
!> p.u.q.parsed
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-literal ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
:: send a pinned literal, expects a %made response with pinned literal
::
^= call-args
2018-12-13 09:34:12 +03:00
[duct=~ type=~ %build live=%.n [%$ %noun !>(**)]]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~ %give %made ~1234.5.6
%complete %success %$ %noun !>(**)
2018-07-20 02:49:11 +03:00
== ==
==
::
%+ welp
results1
(expect-ford-empty ford-gate ~nul)
::
2018-08-23 08:39:10 +03:00
++ test-autocons-same ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
:: if we autocons the same schematic, we should get two of it as a result
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~ type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
[[%$ %noun !>(**)] [%$ %noun !>(**)]]
2018-07-20 02:49:11 +03:00
==
::
^= moves
:~ :* duct=~ %give %made ~1234.5.6 %complete
%success
[%success %$ %noun !>(**)]
[%success %$ %noun !>(**)]
2018-07-20 02:49:11 +03:00
== == ==
::
%+ welp
results1
(expect-ford-empty ford-gate ~nul)
::
2018-08-23 08:39:10 +03:00
++ test-autocons-different ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
:: if we autocons different schematics, we get different values
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~ type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
[[%$ %noun !>(42)] [%$ %noun !>(43)]]
2018-07-20 02:49:11 +03:00
==
::
^= moves
:~ :* duct=~ %give %made ~1234.5.6 %complete
%success
2018-07-20 02:49:11 +03:00
[%success %$ %noun !>(42)]
[%success %$ %noun !>(43)]
== == ==
::
%+ welp
results1
(expect-ford-empty ford-gate ~nul)
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-succeed ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
:: test a pinned scry which succeeds
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~ type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
[%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]
2018-07-20 02:49:11 +03:00
==
::
^= moves
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
2018-07-20 02:49:11 +03:00
== == ==
::
%+ welp
results1
(expect-ford-empty ford-gate ~nul)
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-fail ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-fail ~1234.5.6)
:: attempting to scry a path which fails should produce an error
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~ type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
[%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]
2018-07-20 02:49:11 +03:00
==
::
^= moves
:~ :* duct=~ %give %made ~1234.5.6 %complete
%error
:~ leaf+"scry failed for"
leaf+"%cx /~nul/desk/~1234.5.6/foo/bar"
== == == ==
::
%+ weld
results1
(expect-ford-empty ford-gate ~nul)
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-block ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-block ~1234.5.6)
:: when we scry on a blocked path, expect a subscription move
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~ type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
[%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]
2018-07-20 02:49:11 +03:00
==
::
^= moves
:~ :* duct=~ %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
~ %sing %x [%da ~1234.5.6] /foo/bar
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
:: when clay responds, send a %made
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
==
::
^= moves
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
2018-07-20 02:49:11 +03:00
== == ==
::
;: welp
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-multiblock ^- tang
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
ford-gate
now=~1234.5.6
scry=(scry-block ~1234.5.6)
:: when we scry on a blocked path, expect a subscription move
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/one] type=~ %build live=%.n
[%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/one] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk
~ %sing %x [%da ~1234.5.6] /foo/bar
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
ford-gate
now=~1234.5.7
scry=(scry-block ~1234.5.6)
:: when we scry on a blocked path, expect a subscription move
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/two] type=~ %build live=%.n
[%pin ~1234.5.6 [%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]]
==
::
^= moves ~
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
:: when clay responds, send a %made
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
==
::
^= moves
:~ :* duct=~[/two] %give %made ~1234.5.7 %complete %success
[%scry %noun !>(42)]
==
:* duct=~[/one] %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
== == ==
::
;: welp
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-cancel ^- tang
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
ford-gate
now=~1234.5.6
scry=(scry-block ~1234.5.6)
:: when we scry on a blocked path, expect a subscription move
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/one] type=~ %build live=%.n
[%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/one] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk
~ %sing %x [%da ~1234.5.6] /foo/bar
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/one] type=~ %kill ~]
::
^= moves
:~ :* duct=~[/one] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk ~
== == ==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-live ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/first] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/first] %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=(scry-succeed ~1234.5.7 [%noun !>(43)])
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/first]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
==
::
^= moves
:~ :* duct=~[/first] %give %made ~1234.5.7 %complete %success
[%scry %noun !>(43)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/first] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-live-again ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
:: perform a live scry, we should get a %made and a clay subscription
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/first] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/first] %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=(scry-succeed ~1234.5.7 [%noun !>(42)])
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/second] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/second] %give %made ~1234.5.7 %complete %success
[%scry %noun !>(42)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/second] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/first] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/second] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/second] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
:: tests multiple subscriptions on the same resource at different times
::
:: We can depend on the same paths but at different times. Make sure we can
:: block on /~nul/desk/~1234.5.7/... and /~nul/desk/~1234.5.8/... at the
:: same time.
::
2018-08-23 08:39:10 +03:00
++ test-scry-clay-same-path ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ blocks=(set @da) (sy ~1234.5.7 ~1234.5.8 ~)
::
=/ scry-schematic=schematic:ford-gate
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
=/ autocons=schematic:ford-gate
[[%pin ~1234.5.7 scry-schematic] [%pin ~1234.5.8 scry-schematic]]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-blocks blocks)
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/first] type=~ %build live=%.y autocons]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
%+ expect-eq
!> %- sy
:~ :* duct=~[/first] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.7/foo/bar
%c %warp ~nul %desk
`[%sing %x [%da ~1234.5.7] /foo/bar]
==
:* duct=~[/first] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.8/foo/bar
%c %warp ~nul %desk
`[%sing %x [%da ~1234.5.8] /foo/bar]
== ==
!> (sy moves)
==
2018-07-20 02:49:11 +03:00
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=(scry-blocks blocks)
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.7/foo/bar duct=~[/first]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
:* %c %writ ~ [%x [%da ~1234.5.7] %desk]
/bar/foo %noun scry-type %seven
==
==
::
expected-moves=~
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=(scry-blocks blocks)
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.8/foo/bar duct=~[/first]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
:* %c %writ ~ [%x [%da ~1234.5.8] %desk]
/bar/foo %noun scry-type %eight
==
==
::
^= expected-moves
^- (list move:ford-gate)
:~ :* duct=~[/first] %give %made ~1234.5.6 %complete %success
[%success %scry %noun scry-type %seven]
[%success %scry %noun scry-type %eight]
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/first] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-pinned-in-past ^- tang
2018-07-20 02:49:11 +03:00
::
=/ schematic [%pin ~1234.5.5 [%$ %noun !>(42)]]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/pin] type=~ %build live=%.n schematic]
2018-07-20 02:49:11 +03:00
::
^= expected-moves
2018-07-23 23:58:38 +03:00
:~ :* duct=~[/pin] %give %made ~1234.5.6 %complete
%success %$ %noun !>(42)
2018-07-20 02:49:11 +03:00
== == ==
results1
::
2018-08-23 08:39:10 +03:00
++ test-pinned-in-future ^- tang
2018-07-20 02:49:11 +03:00
::
=/ schematic [%pin ~1234.5.7 [%$ %noun !>(42)]]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/pin] type=~ %build live=%.n schematic]
2018-07-20 02:49:11 +03:00
::
^= expected-moves
2018-07-23 23:58:38 +03:00
:~ :* duct=~[/pin] %give %made ~1234.5.6 %complete
%success %$ %noun !>(42)
2018-07-20 02:49:11 +03:00
== == ==
results1
::
2018-08-23 08:39:10 +03:00
++ test-pinned-in-pin ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/pinned-in-pin] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
%pin ~1234.5.7
%pin ~1234.5.6
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/pinned-in-pin]
2018-07-23 23:58:38 +03:00
%give %made ~1234.5.8 %complete
2018-07-20 02:49:11 +03:00
[%success %scry %noun !>(42)]
== == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-pinned-in-live ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
=/ scry-43 (scry-succeed ~1234.5.7 [%noun !>(43)])
::
=/ schematic=schematic:ford-gate
:* %same %pin ~1234.5.6
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
=/ build=build:ford-gate [~1234.5.6 schematic]
=/ result=build-result:ford-gate
[%success [%scry %noun !>(42)]]
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-42
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/live] type=~ %build live=%.y schematic]
2018-07-20 02:49:11 +03:00
moves=[duct=~[/live] %give %made ~1234.5.6 %complete result]~
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/live] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-live-build-that-blocks ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-blocked (scry-block ~1234.5.6)
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
=/ scry-43 (scry-succeed ~1234.5.8 [%noun !>(43)])
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-blocked
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/live] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/live] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
~ %sing %x [%da ~1234.5.6] /foo/bar
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-42
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~[/live]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
==
::
^= moves
:~ :* duct=~[/live] %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/live] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-43
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/live]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.8] (sy [%x /foo/bar]~)]
==
::
^= moves
:~ :* duct=~[/live] %give %made ~1234.5.8 %complete %success
[%scry %noun !>(43)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/live] %pass wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.8] (sy [%x /foo/bar]~)]
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/live] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/live] %pass wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-live-and-once ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-blocked (scry-block ~1234.5.6)
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-blocked
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/live] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/live] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
~ %sing %x [%da ~1234.5.6] /foo/bar
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-blocked
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/once] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%pin ~1234.5.6 [%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]]
==
::
moves=~
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~[/live]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
==
::
^= moves
:~ :* duct=~[/live] %give %made ~1234.5.6 %complete
[%success [%scry %noun !>(42)]]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/live] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
==
2018-07-23 23:58:38 +03:00
:* duct=~[/once] %give %made ~1234.5.7 %complete
[%success [%scry %noun !>(42)]]
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/live] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/live] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-live-two-deep ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
=/ scry-43 (scry-succeed ~1234.5.7 [%noun !>(43)])
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-42
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/two-deep-4u] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%same [%scry %c care=%x rail=[[~nul %desk] /bar/foo]]]
==
::
^= moves
:~ :* duct=~[/two-deep-4u] %give %made ~1234.5.6 %complete
%success [%scry %noun !>(42)]
2018-07-20 02:49:11 +03:00
==
:* duct=~[/two-deep-4u] %pass
2018-12-14 03:15:20 +03:00
wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-43
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/two-deep-4u]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
==
::
^= moves
:~ :* duct=~[/two-deep-4u] %give %made ~1234.5.7 %complete
%success [%scry %noun !>(43)]
2018-07-20 02:49:11 +03:00
==
:* duct=~[/two-deep-4u] %pass
2018-12-14 03:15:20 +03:00
wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/two-deep-4u] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/two-deep-4u] %pass
2018-12-14 03:15:20 +03:00
wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-live-three-deep ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /bar/foo]]
[%noun scry-type %it-doesnt-matter]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /bar/foo]]
[%noun scry-type %changed]
==
::
=/ scry (scry-with-results scry-results)
::
=/ formula=hoon (ream '`@tas`%constant')
=/ subject-schematic=schematic:ford-gate
[%scry %c %x [~nul %desk] /bar/foo]
::
=/ ride=schematic:ford-gate [%ride formula subject-schematic]
=/ same=schematic:ford-gate [%same ride]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/ride] type=~ %build live=%.y same]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete
[%success [%ride scry-type %constant]]
2018-07-20 02:49:11 +03:00
==
2018-12-14 03:15:20 +03:00
:* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/ride]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
==
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/ride] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-live-triangle ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /bar/foo]]
[%noun !>(%it-does-in-fact-matter)]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /bar/foo]]
[%noun !>(%changed)]
==
::
=/ scry (scry-with-results scry-results)
::
=/ formula=hoon (ream '`@tas`%constant')
=/ subject-schematic=schematic:ford-gate
[%scry %c %x [~nul %desk] /bar/foo]
::
=/ ride-type=type [%atom %tas ~]
=/ ride=schematic:ford-gate [%ride formula subject-schematic]
=/ autocons=schematic:ford-gate [ride subject-schematic]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/ride] type=~ %build live=%.y autocons]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete %success
[%success [%ride ride-type %constant]]
[%success [%scry %noun !>(%it-does-in-fact-matter)]]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/ride]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
==
::
^= moves
:~ :* duct=~[/ride] %give %made ~1234.5.7 %complete %success
[%success [%ride ride-type %constant]]
[%success [%scry %noun !>(%changed)]]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/ride] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
:: like +test-live-triangle, but with another pinned build
::
:: Ensures that we deal with various issues with live builds which
:: were partially pinned and their interaction with other live builds.
::
2018-08-23 08:39:10 +03:00
++ test-live-and-pinned-triangle ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /bar/foo]]
[%noun scry-type %it-does-in-fact-matter]
::
:- [%cx [[~nul %home %da ~1234.5.7] /bar/foo]]
[%noun scry-type %it-does-in-fact-matter]
==
::
=/ scry (scry-with-results scry-results)
::
=/ formula=hoon (ream '`@tas`%constant')
=/ subject-schematic=schematic:ford-gate [%scry %c %x [~nul %home] /bar/foo]
::
=/ ride-type=type [%atom %tas ~]
=/ ride=schematic:ford-gate [%ride formula subject-schematic]
=/ autocons=schematic:ford-gate [ride subject-schematic]
::
=/ static=schematic:ford-gate [%same [%pin ~1234.5.6 autocons]]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/static] type=~ %build live=%.y static]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/static] %give %made ~1234.5.6 %complete %success
[%success [%ride ride-type %constant]]
[%success [%scry %noun scry-type %it-does-in-fact-matter]]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/autocons] type=~ %build live=%.y autocons]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/autocons] %give %made ~1234.5.7 %complete %success
[%success [%ride ride-type %constant]]
[%success [%scry %noun scry-type %it-does-in-fact-matter]]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/autocons] %pass wire=/clay-sub/~nul/home/~1234.5.7
%c %warp ~nul %home
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/static] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/autocons] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/autocons] %pass wire=/clay-sub/~nul/home/~1234.5.7
%c %warp ~nul %home ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-call ^- tang
2018-07-20 02:49:11 +03:00
::
=/ sample-schematic=schematic:ford-gate [%$ %noun !>(5)]
=/ gate-schematic=schematic:ford-gate [%$ %noun !>(|=(a=@ud +(a)))]
=/ call-schematic=schematic:ford-gate
[%call gate-schematic sample-schematic]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/call] type=~ %build live=%.y call-schematic]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %call *] i.moves)
::
=/ result=vase |7:i.moves
::
(expect-eq !>(6) result)
2018-07-20 02:49:11 +03:00
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/call] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-call-scry-succeed ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
::
=/ sample-schematic=schematic:ford-gate [%$ %noun !>(24)]
=/ gate-schematic=schematic:ford-gate
[%$ %noun !>(|=(a=@ud .^(@ud %cx /~nul/desk/~1234.5.6/foo/bar)))]
=/ call-schematic=schematic:ford-gate
[%call gate-schematic sample-schematic]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-42
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/call] type=~ %build live=%.y call-schematic]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
::
?> ?=([* %give %made @da %complete %success %call *] i.moves)
::
=/ result=vase |7:i.moves
::
(expect-eq !>(42) result)
2018-07-20 02:49:11 +03:00
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/call] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
2018-08-23 08:39:10 +03:00
++ test-call-scry-fail ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-failed (scry-fail ~1234.5.6)
::
=/ sample-schematic=schematic:ford-gate [%$ %noun !>(24)]
=/ gate-schematic=schematic:ford-gate
[%$ %noun !>(|=(a=@ud .^(@ud %cx /~nul/desk/~1234.5.6/foo/bar)))]
=/ call-schematic=schematic:ford-gate
[%call gate-schematic sample-schematic]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-failed
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/dead] type=~ %build live=%.y call-schematic]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %error *] i.moves)
:: compare the move to the expected move, omitting check on stack trace
::
%+ expect-eq
!> :* duct=~[/dead] %give %made ~1234.5.6 %complete
[%error [leaf+"ford: %call execution failed:" ~]]
==
!> i.moves(|7 ~)
==
2018-07-20 02:49:11 +03:00
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/dead] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
::
2018-08-23 08:39:10 +03:00
++ test-call-scry-block ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-blocked (scry-block ~1234.5.6)
::
=/ sample-schematic=schematic:ford-gate [%$ %noun !>(24)]
=/ gate-schematic=schematic:ford-gate
[%$ %noun !>(|=(a=@ud .^(@ud %cx /~nul/desk/~1234.5.6/foo/bar)))]
=/ call-schematic=schematic:ford-gate
[%call gate-schematic sample-schematic]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-blocked
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/live] type=~ %build live=%.y call-schematic]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/live] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
~ %sing %x [%da ~1234.5.6] /foo/bar
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-blocked
::
^= call-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %call *] i.moves)
::
=/ result |7:i.moves
2018-07-20 02:49:11 +03:00
::
(expect-eq !>(42) result)
2018-07-20 02:49:11 +03:00
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/live] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
moves=~
==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
:: +test-call-scry-varies: call with an argument which varies
::
:: This test reads the sample for a %call schematic from clay. This sample
:: is a date. Inside of the gate called, we scry on a path based on the
:: passed in sample date.
::
2018-08-23 08:39:10 +03:00
++ test-call-scry-varies ^- tang
2018-07-20 02:49:11 +03:00
::
=/ date-type=type [%atom %da ~]
=/ term-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /timer]]
[%noun date-type ~1234.5.6]
::
:- [%cx [[~nul %desk %da ~1234.5.6] /result]]
[%noun term-type %first]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /timer]]
[%noun date-type ~1234.5.7]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /result]]
[%noun term-type %second]
==
::
=/ scry (scry-with-results scry-results)
::
=/ sample-schematic=schematic:ford-gate
[%scry [%c care=%x bel=[[~nul %desk] /timer]]]
=/ gate-schematic=schematic:ford-gate
[%$ %noun !>(|=(a=@da .^(@tas %cx /~nul/desk/(scot %da a)/result)))]
=/ call-schematic=schematic:ford-gate
[%call gate-schematic sample-schematic]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
^= call-args
2018-12-13 09:34:12 +03:00
[duct=~[/call] type=~ %build live=%.y call-schematic]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
?> ?=([* %give %made @da %complete %success %call *] i.moves)
::
%+ weld
=/ result |7:i.moves
(expect-eq !>(%first) result)
2018-07-20 02:49:11 +03:00
:: make sure the other move is a subscription
::
%+ expect-eq
2018-12-14 03:15:20 +03:00
!> :* duct=~[/call] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
`[%mult [%da ~1234.5.6] (sy [%x /timer] ~)]
==
!> i.t.moves
==
2018-07-20 02:49:11 +03:00
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
^= call-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/call]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /timer]~)]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
?> ?=([* %give %made @da %complete %success %call *] i.moves)
::
%+ weld
=/ result |7:i.moves
(expect-eq !>(%second) result)
2018-07-20 02:49:11 +03:00
:: make sure the other move is a subscription
::
%+ expect-eq
2018-12-14 03:15:20 +03:00
!> :* duct=~[/call] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
`[%mult [%da ~1234.5.7] (sy [%x /timer] ~)]
==
!> i.t.moves
==
2018-07-20 02:49:11 +03:00
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/call] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/call] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-dude ^- tang
2018-07-20 02:49:11 +03:00
::
=/ schematic=schematic:ford-gate
2019-02-05 03:58:22 +03:00
:* %dude >%test-no-error<
2018-07-20 02:49:11 +03:00
[%scry [%c care=%x bel=[[~nul %desk] /bar/foo]]]
==
::
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-42
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/once] type=~ %build live=%.n schematic]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/once] %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-dude-error ^- tang
2018-07-20 02:49:11 +03:00
::
=/ schematic=schematic:ford-gate
2019-02-05 03:58:22 +03:00
:* %dude >%in-the-error-message<
2018-07-20 02:49:11 +03:00
[%scry [%c care=%x bel=[[~nul %desk] /bar/foo]]]
==
::
=/ scry-42 (scry-fail ~1234.5.6)
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-42
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/once] type=~ %build live=%.n schematic]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/once] %give %made ~1234.5.6 %complete
%error
:~ leaf+"%in-the-error-message"
leaf+"scry failed for"
leaf+"%cx /~nul/desk/~1234.5.6/foo/bar"
== == == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-hood ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
=/ scry
%- scry-with-results
^- (map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /hoon/bar/foo]]
:* %noun scry-type
'!. |=(a=@ud +(a))'
==
==
::
=/ schematic=schematic:ford-gate [%hood [[~nul %desk] /hoon/bar/foo]]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/hood] type=~ %build live=%.y schematic]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/hood] %give %made ~1234.5.6
%complete %success %hood
:* source-rail=[[~nul %desk] /hoon/bar/foo]
zuse-version=309
structures=~
libraries=~
cranes=~
^= sources
:~ :* %dbug
[/~nul/desk/0/foo/bar/hoon [1 1] [1 19]]
(ream '|=(a=@ud +(a))')
== == == ==
2018-12-14 03:15:20 +03:00
:* duct=~[/hood] %pass /clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar/hoon] ~)]
== == ==
::
2018-07-23 23:58:38 +03:00
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-23 23:58:38 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/hood] type=~ %kill ~]
2018-07-23 23:58:38 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/hood] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk ~
2018-07-23 23:58:38 +03:00
== == ==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-slim ^- tang
2018-07-20 02:49:11 +03:00
::
=/ formula=hoon (ream '(add 2 2)')
=/ subject-type=type -:!>(.)
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-07-23 23:58:38 +03:00
^= call-args
2018-12-13 09:34:12 +03:00
[duct=~[/dead] type=~ %build live=%.y [%slim subject-type formula]]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/dead] %give %made ~1234.5.6 %complete
[%success [%slim (~(mint ut subject-type) [%noun formula])]]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/dead] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-slit ^- tang
2018-07-20 02:49:11 +03:00
::
=/ gate=vase (ride %noun '|=(a=@ud ["one" a])')
=/ sample=vase !>(42)
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/slit] type=~ %build live=%.y [%slit gate sample]]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %slit *] i.moves)
:: we are expecting a type, and all we can do is ensure it nests in
:: the right type
::
=/ expected-type=type -:!>([*tape *@ud])
=/ actual-type=type |7:i.moves
%+ expect-eq
!> &
!> (~(nest ut actual-type) | expected-type)
2018-07-20 02:49:11 +03:00
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/slit] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-slit-error ^- tang
2018-07-20 02:49:11 +03:00
::
=/ gate=vase (ride %noun '|=(a=@ud ["one" a])')
=/ sample=vase !>("a tape instead of @ud")
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/slit] type=~ %build live=%.y [%slit gate sample]]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %error *] i.moves)
:: ignore last message; contains source positions in the stack trace
::
=/ messages=tang (scag 4 `tang`|6:i.moves)
::
%+ expect-eq
!> :~ [%palm ["." "-" "" ""] [%leaf "have"] [%leaf "\"\""] ~]
:~ %palm ["." "-" "" ""]
[%leaf "want"]
[%palm ["/" "" "" ""] [%leaf "a"] [%leaf "@ud"] ~]
==
[%leaf "ford: %slit failed:"]
[%leaf "nest-fail"]
==
!> messages
2018-07-20 02:49:11 +03:00
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/slit] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-ride ^- tang
2018-07-20 02:49:11 +03:00
::
=/ fun |=(a=@ (add 2 a))
=/ formula=hoon (ream '!: (fun 3)')
=/ subject-schematic=schematic:ford-gate [%$ %noun !>(.)]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/dead] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%ride formula subject-schematic]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %ride *] i.moves)
::
=/ result |7:i.moves
(expect-eq !>(5) result)
2018-07-20 02:49:11 +03:00
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/dead] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-ride-scry-succeed ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
::
=/ formula=hoon (ream '!: .^(* %cx /~nul/desk/~1234.5.6/foo/bar)')
=/ subject-schematic=schematic:ford-gate [%$ %noun !>(.)]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-42
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/dead] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%ride formula subject-schematic]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %ride *] i.moves)
::
=/ result |7:i.moves
(expect-eq !>(42) result)
2018-07-20 02:49:11 +03:00
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/dead] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-ride-scry-fail ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-failed (scry-fail ~1234.5.6)
::
=/ formula=hoon (ream '!: .^(* %cx /~nul/desk/~1234.5.6/foo/bar)')
=/ subject-schematic=schematic:ford-gate [%$ %noun !>(.)]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-failed
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/dead] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%ride formula subject-schematic]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %error *] i.moves)
:: compare the move to the expected move, omitting check on stack trace
::
%+ expect-eq
!> :* duct=~[/dead] %give %made ~1234.5.6 %complete
[%error [leaf+"ford: %ride failed to execute:" ~]]
==
!> i.moves(|7 ~)
==
2018-07-20 02:49:11 +03:00
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/dead] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
moves=~
==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-ride-scry-block ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-blocked (scry-block ~1234.5.6)
::
=/ formula=hoon (ream '!: .^(* %cx /~nul/desk/~1234.5.6/foo/bar)')
=/ subject-schematic=schematic:ford-gate [%$ %noun !>(.)]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-blocked
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/live] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%ride formula subject-schematic]
==
::
^= moves
:~ :* duct=~[/live] %pass
2018-12-14 03:15:20 +03:00
wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
~ %sing %x [%da ~1234.5.6] /foo/bar
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
:: TODO: using +scry-is-forbidden causes a bail: 4
::
scry=scry-blocked
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~[/live]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %ride *] i.moves)
::
=/ result |7:i.moves
(expect-eq !>(42) result)
2018-07-20 02:49:11 +03:00
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/live] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
moves=~
==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-ride-scry-promote ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /bar/foo]]
[%noun scry-type %it-doesnt-matter]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /bar/foo]]
[%noun scry-type %changed]
==
::
=/ scry (scry-with-results scry-results)
::
=/ formula=hoon (ream '`@tas`%constant')
=/ subject-schematic=schematic:ford-gate [%scry %c %x [~nul %desk] /bar/foo]
::
=/ ride=schematic:ford-gate [%ride formula subject-schematic]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/ride] type=~ %build live=%.y ride]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete
[%success [%ride scry-type %constant]]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/ride]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
==
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/ride] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/ride] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-five-oh-fora ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type
[%cell [%face %title [%atom %t ~]] [%face %contents -:!>("")]]
2018-07-20 02:49:11 +03:00
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /a/posts]]
[%noun scry-type [title='post-a' contents="post-a-contents"]]
::
:- [%cx [[~nul %desk %da ~1234.5.6] /b/posts]]
[%noun scry-type [title='post-b' contents="post-b-contents"]]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /a/posts]]
[%noun scry-type [title='post-a' contents="post-a-contents"]]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /b/posts]]
[%noun scry-type [title='post-b' contents="post-b-contents"]]
::
:- [%cx [[~nul %desk %da ~1234.5.8] /a/posts]]
[%noun scry-type [title='post-a' contents="post-a-contents-changed"]]
==
::
=/ scry (scry-with-results scry-results)
::
=/ post-a=schematic:ford-gate [%scry [%c %x [~nul %desk] /a/posts]]
=/ title-a=schematic:ford-gate [%ride (ream '!: title') post-a]
::
=/ post-b=schematic:ford-gate [%scry [%c %x [~nul %desk] /b/posts]]
=/ title-b=schematic:ford-gate [%ride (ream '!: title') post-b]
::
=/ sidebar=schematic:ford-gate [title-a title-b]
::
=/ rendered-a=schematic:ford-gate [post-a sidebar]
=/ rendered-b=schematic:ford-gate [post-b sidebar]
:: first, ask ford to build rendered-a
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/post-a] type=~ %build live=%.y rendered-a]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> ?=([^ ^ ~] moves)
%+ welp
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-a]
type=scry-type
date=~1234.5.6
title='post-a'
contents="post-a-contents"
==
%+ expect-eq
!> :* duct=~[/post-a] %pass
2018-12-14 03:15:20 +03:00
wire=/clay-sub/~nul/desk/~1234.5.6 %c %warp
~nul %desk
`[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)]
==
!> i.t.moves
==
2018-07-20 02:49:11 +03:00
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/post-b] type=~ %build live=%.y rendered-b]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> ?=([^ ^ ~] moves)
%+ welp
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-b]
type=scry-type
date=~1234.5.7
title='post-b'
contents="post-b-contents"
==
%+ expect-eq
!> :* duct=~[/post-b] %pass
2018-12-14 03:15:20 +03:00
wire=/clay-sub/~nul/desk/~1234.5.7 %c %warp
~nul %desk
`[%mult [%da ~1234.5.7] (sy [%x /posts/a] [%x /posts/b] ~)]
==
!> i.t.moves
==
2018-07-20 02:49:11 +03:00
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/post-a]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.8] (sy [%x /posts/a]~)]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> ?=([^ ^ ~] moves)
%+ welp
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-a]
type=scry-type
date=~1234.5.8
title='post-a'
contents="post-a-contents-changed"
==
%+ expect-eq
!> :* duct=~[/post-a] %pass
2018-12-14 03:15:20 +03:00
wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk
`[%mult [%da ~1234.5.8] (sy [%x /posts/a] [%x /posts/b] ~)]
==
!> i.t.moves
==
2018-07-20 02:49:11 +03:00
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.7 duct=~[/post-b]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.8] (sy [%x /posts/a]~)]
==
::
moves=~
==
::
=^ results5 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.10
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/post-a] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
moves=~
==
::
=^ results6 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.11
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/post-b] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/post-a] %pass wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
results5
results6
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-alts ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
2018-07-21 00:53:13 +03:00
:- [%cx [[~nul %home %da ~1234.5.6] /one/scry]]
2018-07-20 02:49:11 +03:00
~
::
2018-07-21 00:53:13 +03:00
:- [%cx [[~nul %home %da ~1234.5.6] /two/scry]]
2018-07-20 02:49:11 +03:00
~
::
2018-07-21 00:53:13 +03:00
:- [%cx [[~nul %home %da ~1234.5.7] /one/scry]]
2018-07-20 02:49:11 +03:00
~
::
2018-07-21 00:53:13 +03:00
:- [%cx [[~nul %home %da ~1234.5.7] /two/scry]]
2018-07-20 02:49:11 +03:00
`[%noun scry-type 'scry-two']
::
2018-07-21 00:53:13 +03:00
:- [%cx [[~nul %home %da ~1234.5.8] /one/scry]]
2018-07-20 02:49:11 +03:00
`[%noun scry-type 'scry-one']
==
::
=/ scry (scry-with-results-and-failures scry-results)
::
2018-07-21 00:53:13 +03:00
=/ scry1=schematic:ford-gate [%scry [%c %x [~nul %home] /one/scry]]
=/ scry2=schematic:ford-gate [%scry [%c %x [~nul %home] /two/scry]]
2018-07-20 02:49:11 +03:00
=/ alts=schematic:ford-gate [%alts [scry1 scry2 ~]]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/alts] type=~ %build live=%.y alts]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/alts] %give %made ~1234.5.6 %complete %error
:~ [%leaf "%alts: all options failed"]
[%leaf "option"]
:+ %rose [" " "\{" "}"] :~
[%leaf "scry failed for"]
[%leaf "%cx /~nul/home/~1234.5.6/scry/one"]
==
[%leaf "option"]
:+ %rose [" " "\{" "}"] :~
[%leaf "scry failed for"]
[%leaf "%cx /~nul/home/~1234.5.6/scry/two"]
==
== ==
2018-12-14 03:15:20 +03:00
:* duct=~[/alts] %pass wire=/clay-sub/~nul/home/~1234.5.6
%c %warp ~nul %home
2018-07-21 00:53:13 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /scry/two] [%x /scry/one] ~)]
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/home/~1234.5.6 duct=~[/alts]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /scry/two]~)]
==
::
^= moves
:~ :* duct=~[/alts] %give %made ~1234.5.7 %complete
%success %alts %success %scry %noun scry-type 'scry-two'
==
2018-12-14 03:15:20 +03:00
:* duct=~[/alts] %pass wire=/clay-sub/~nul/home/~1234.5.7
%c %warp ~nul %home
2018-07-21 00:53:13 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /scry/two] [%x /scry/one] ~)]
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/home/~1234.5.6 duct=~[/alts]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.8] (sy [%x /scry/one]~)]
==
::
^= moves
:~ :* duct=~[/alts] %give %made ~1234.5.8 %complete
%success %alts %success %scry %noun scry-type 'scry-one'
==
2018-12-14 03:15:20 +03:00
:* duct=~[/alts] %pass wire=/clay-sub/~nul/home/~1234.5.8
%c %warp ~nul %home
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.8] (sy [%x /scry/one] ~)]
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/alts] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/alts] %pass wire=/clay-sub/~nul/home/~1234.5.8
%c %warp ~nul %home ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-alts-and-live ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /one/scry]]
~
::
:- [%cx [[~nul %desk %da ~1234.5.6] /two/scry]]
`[%noun scry-type 'scry-two']
::
:- [%cx [[~nul %desk %da ~1234.5.7] /one/scry]]
~
::
:- [%cx [[~nul %desk %da ~1234.5.7] /two/scry]]
`[%noun scry-type 'scry-two']
::
:- [%cx [[~nul %desk %da ~1234.5.8] /one/scry]]
`[%noun scry-type 'scry-one']
==
::
=/ scry (scry-with-results-and-failures scry-results)
::
=/ scry2=schematic:ford-gate [%scry [%c %x [~nul %desk] /two/scry]]
=/ same=schematic:ford-gate [%same scry2]
:: depend on scry2 for the duration of the test
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/same] type=~ %build live=%.y same]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/same] %give %made ~1234.5.6 %complete
%success %scry %noun scry-type 'scry-two'
2018-07-20 02:49:11 +03:00
==
2018-12-14 03:15:20 +03:00
:* duct=~[/same] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /scry/two] ~)]
== == ==
::
=/ scry1=schematic:ford-gate [%scry [%c %x [~nul %desk] /one/scry]]
=/ alts=schematic:ford-gate [%alts [scry1 scry2 ~]]
:: call the alts schematic
::
:: The alts schematic should fail to read /scry/one, and should fallback
:: to /scry/two.
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/alts] type=~ %build live=%.y alts]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/alts] %give %made ~1234.5.7 %complete
%success %alts %success %scry %noun scry-type 'scry-two'
==
2018-12-14 03:15:20 +03:00
:* duct=~[/alts] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /scry/two] [%x /scry/one] ~)]
== == ==
::
:: tell ford that /scry/one exists now
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.7 duct=~[/alts]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.8] (sy [%x /scry/one]~)]
==
::
^= moves
:~ :* duct=~[/alts] %give %made ~1234.5.8 %complete
%success %alts %success %scry %noun scry-type 'scry-one'
==
:: we subscribe to both paths because /same still exists.
::
2018-12-14 03:15:20 +03:00
:* duct=~[/alts] %pass wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk
`[%mult [%da ~1234.5.8] (sy [%x /scry/one] ~)]
2018-07-20 02:49:11 +03:00
== == ==
::
:: kill the /same build
::
:: We should no longer subscribe to /scry/two in the resulting clay
:: subscription.
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/same] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/same] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results5 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.10
scry=scry
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/alts] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/alts] %pass wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
results5
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-double-alts ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /one/scry]]
~
:- [%cx [[~nul %desk %da ~1234.5.6] /two/scry]]
`[%noun scry-type 'scry-two']
:- [%cx [[~nul %desk %da ~1234.5.6] /three/scry]]
2018-07-20 02:49:11 +03:00
~
::
:- [%cx [[~nul %desk %da ~1234.5.7] /one/scry]]
~
2018-07-20 02:49:11 +03:00
:- [%cx [[~nul %desk %da ~1234.5.7] /two/scry]]
`[%noun scry-type 'scry-two']
:- [%cx [[~nul %desk %da ~1234.5.7] /three/scry]]
~
2018-07-20 02:49:11 +03:00
::
:- [%cx [[~nul %desk %da ~1234.5.8] /one/scry]]
~
2018-07-20 02:49:11 +03:00
:- [%cx [[~nul %desk %da ~1234.5.8] /two/scry]]
`[%noun scry-type 'scry-two']
:- [%cx [[~nul %desk %da ~1234.5.8] /three/scry]]
`[%noun scry-type 'scry-three']
2018-07-20 02:49:11 +03:00
::
:- [%cx [[~nul %desk %da ~1234.5.9] /one/scry]]
`[%noun scry-type 'scry-one']
:- [%cx [[~nul %desk %da ~1234.5.9] /two/scry]]
`[%noun scry-type 'scry-two-changed']
:- [%cx [[~nul %desk %da ~1234.5.9] /three/scry]]
`[%noun scry-type 'scry-three']
2018-07-20 02:49:11 +03:00
==
::
=/ scry (scry-with-results-and-failures scry-results)
::
=/ scry1=schematic:ford-gate [%scry [%c %x [~nul %desk] /one/scry]]
=/ scry2=schematic:ford-gate [%scry [%c %x [~nul %desk] /two/scry]]
=/ scry3=schematic:ford-gate [%scry [%c %x [~nul %desk] /three/scry]]
=/ alts1=schematic:ford-gate [%alts [scry1 scry2 ~]]
=/ alts2=schematic:ford-gate [%alts [scry3 scry2 ~]]
:: alts1 will depend on both scry1 and scry2
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/first] type=~ %build live=%.y alts1]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/first] %give %made ~1234.5.6 %complete
%success %alts %success %scry %noun scry-type 'scry-two'
==
2018-12-14 03:15:20 +03:00
:* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.6
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /scry/one] [%x /scry/two] ~)]
== == ==
:: alts2 will depend on both scry3 and scry2
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/second] type=~ %build live=%.y alts2]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/second] %give %made ~1234.5.7 %complete
%success %alts %success %scry %noun scry-type 'scry-two'
==
2018-12-14 03:15:20 +03:00
:* duct=~[/second] %pass wire=/clay-sub/~nul/desk/~1234.5.7
%c %warp ~nul %desk ~ %mult [%da ~1234.5.7]
(sy [%x /scry/two] [%x /scry/three] ~)
2018-07-20 02:49:11 +03:00
== == ==
::
:: alts2 should now just return 'scry-three'
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.7 duct=~[/second]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.8] (sy [%x /scry/three]~)]
==
::
^= moves
:~ :* duct=~[/second] %give %made ~1234.5.8 %complete
%success %alts %success %scry %noun scry-type 'scry-three'
==
2018-12-14 03:15:20 +03:00
:* duct=~[/second] %pass wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk ~ %mult [%da ~1234.5.8]
(sy [%x /scry/three] ~)
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk/~1234.5.6 duct=~[/first]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.9] (sy [%x /scry/one] [%x /scry/two] ~)]
==
::
^= moves
:~ :* duct=~[/first] %give %made ~1234.5.9 %complete
%success %alts %success %scry %noun scry-type 'scry-one'
==
2018-12-14 03:15:20 +03:00
:* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.9
%c %warp ~nul %desk ~ %mult [%da ~1234.5.9]
(sy [%x /scry/one] ~)
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results5 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.10
scry=scry
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/first] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/first] %pass wire=/clay-sub/~nul/desk/~1234.5.9
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
=^ results6 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.11
scry=scry
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/second] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/second] %pass wire=/clay-sub/~nul/desk/~1234.5.8
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
results5
results6
(expect-ford-empty ford-gate ~nul)
==
:: +test-cache-reclamation-trivial: reclaim cache on a blank slate ford
::
2018-08-23 08:39:10 +03:00
++ disabled-test-cache-reclamation-trivial
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
:: send a pinned literal, expects a %made response with pinned literal
::
^= call-args
2018-12-13 09:34:12 +03:00
[duct=~[/trivial] type=~ %build live=%.n [%$ %noun !>(**)]]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/trivial] %give %made ~1234.5.6
%complete %success %$ %noun !>(**)
2018-07-20 02:49:11 +03:00
== ==
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
:: ask ford to wipe its cache
::
2018-08-17 02:00:33 +03:00
call-args=[duct=~[/trivial] type=~ %wipe 10]
2018-07-20 02:49:11 +03:00
:: cache wiping should never produce any moves
::
moves=~
==
::
;: welp
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ disabled-test-cache-reclamation-live-rebuild
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/build] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
==
::
^= moves
:~ :* duct=~[/build] %give %made ~1234.5.6 %complete %success
[%scry %noun !>(42)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/build] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
:: ask ford to wipe its cache
::
2018-08-17 02:00:33 +03:00
call-args=[duct=~[/build] type=~ %wipe 10]
2018-07-20 02:49:11 +03:00
:: cache wiping should never produce any moves
::
moves=~
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=(scry-succeed ~1234.5.7 [%noun !>(43)])
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk duct=~[/build]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
==
::
^= moves
:~ :* duct=~[/build] %give %made ~1234.5.7 %complete %success
[%scry %noun !>(43)]
==
2018-12-14 03:15:20 +03:00
:* duct=~[/build] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/build] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/build] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ disabled-test-cache-reclamation-live-promote
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type [%atom %tas ~]
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /bar/foo]]
[%noun scry-type %it-doesnt-matter]
::
:- [%cx [[~nul %desk %da ~1234.5.7] /bar/foo]]
[%noun scry-type %changed]
==
::
=/ scry (scry-with-results scry-results)
::
=/ formula=hoon (ream '`@tas`%constant')
=/ subject-schematic=schematic:ford-gate
[%scry %c %x [~nul %desk] /bar/foo]
::
=/ ride=schematic:ford-gate [%ride formula subject-schematic]
=/ same=schematic:ford-gate [%same ride]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/ride] type=~ %build live=%.y same]
2018-07-20 02:49:11 +03:00
::
^= moves
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete
2018-07-23 23:58:38 +03:00
[%success [%ride scry-type %constant]]
2018-07-20 02:49:11 +03:00
==
2018-12-14 03:15:20 +03:00
:* duct=~[/ride] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry-is-forbidden
:: ask ford to wipe its cache
::
2018-08-17 02:00:33 +03:00
call-args=[duct=~[/ride] type=~ %wipe 10]
2018-07-20 02:49:11 +03:00
:: cache wiping should never produce any moves
::
moves=~
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk duct=~[/ride]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
==
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/ride] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk
2018-07-20 02:49:11 +03:00
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
== == ==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/ride] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/ride] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
:: tests that doing a cache reclamation during the five-oh-fora rebuild works
::
2018-08-23 08:39:10 +03:00
++ disabled-test-five-oh-cache-reclamation ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-type=type
[%cell [%face %title [%atom %t ~]] [%face %contents -:!>("")]]
2018-07-20 02:49:11 +03:00
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /a/posts]]
[%noun scry-type [title='post-a' contents="post-a-contents"]]
::
:- [%cx [[~nul %desk %da ~1234.5.6] /b/posts]]
[%noun scry-type [title='post-b' contents="post-b-contents"]]
::
:- [%cx [[~nul %desk %da ~1234.5.9] /a/posts]]
[%noun scry-type [title='post-a' contents="post-a-contents-changed"]]
::
:: unchanged, but might be requested if cache entry gets wiped
::
:- [%cx [[~nul %desk %da ~1234.5.9] /b/posts]]
[%noun scry-type [title='post-b' contents="post-b-contents"]]
==
::
=/ scry (scry-with-results scry-results)
::
=/ post-a=schematic:ford-gate [%scry [%c %x [~nul %desk] /a/posts]]
=/ title-a=schematic:ford-gate [%ride (ream '!: title') post-a]
::
=/ post-b=schematic:ford-gate [%scry [%c %x [~nul %desk] /b/posts]]
=/ title-b=schematic:ford-gate [%ride (ream '!: title') post-b]
::
=/ sidebar=schematic:ford-gate [title-a title-b]
::
=/ rendered-a=schematic:ford-gate [post-a sidebar]
=/ rendered-b=schematic:ford-gate [post-b sidebar]
:: first, ask ford to build rendered-a
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/post-a] type=~ %build live=%.y rendered-a]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> ?=([^ ^ ~] moves)
%+ welp
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-a]
type=scry-type
date=~1234.5.6
title='post-a'
contents="post-a-contents"
==
%+ expect-eq
2018-12-14 03:15:20 +03:00
!> :* duct=~[/post-a] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk
`[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)]
==
!> i.t.moves
==
2018-07-20 02:49:11 +03:00
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=scry
::
2018-12-13 09:34:12 +03:00
call-args=[duct=~[/post-b] type=~ %build live=%.y rendered-b]
2018-07-20 02:49:11 +03:00
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> ?=([^ ~] moves)
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-b]
type=scry-type
date=~1234.5.7
title='post-b'
contents="post-b-contents"
== ==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-08-17 02:00:33 +03:00
call-args=[duct=~[/wipe] type=~ %wipe 10]
2018-07-20 02:49:11 +03:00
moves=~
==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=scry
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/desk duct=~[/post-a]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.9] (sy [%x /posts/a]~)]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
=+ length=(lent moves)
:: deal with mug ordering
::
:: This test depends on the mugs of types stored in ford, which is
:: dependent on the parse tree of this file. There are two valid
:: responses, one where we send a spurious move about %post-b
:: because it was the entry which was evicted from the cache and one
:: where we don't because it wasn't. Check both cases.
::
?: =(length 2)
:: the simple case where we don't send a spurious post-b %made
::
?> ?=([^ ^ ~] moves)
::
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-a]
type=scry-type
date=~1234.5.9
title='post-a'
contents="post-a-contents-changed"
==
:: the complex case
::
:: Not only do we send a spurious %made, we don't have a set order
:: that these events happen in, so check both ways.
::
?> ?=([^ ^ ^ ~] moves)
::
=/ post-a-first=tang
%+ welp
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-a]
type=scry-type
date=~1234.5.9
title='post-a'
contents="post-a-contents-changed"
==
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.t.moves
duct=~[/post-b]
type=scry-type
date=~1234.5.9
title='post-b'
contents="post-b-contents"
==
:: if we got a ~ for post-a-first, everything is fine
::
?~ post-a-first
~
:: otherwise, its either post-b first or an error.
::
:: Either way, return post-b first check.
::
%+ welp
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.moves
duct=~[/post-b]
type=scry-type
date=~1234.5.9
title='post-b'
contents="post-b"
==
::
2018-08-23 08:39:10 +03:00
%- verify-post-made :*
2018-07-20 02:49:11 +03:00
move=i.t.moves
duct=~[/post-a]
type=scry-type
date=~1234.5.9
title='post-a'
contents="post-a-contents-changed"
== ==
::
=^ results5 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.10
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/post-b] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
moves=~
==
::
=^ results6 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.11
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/post-a] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/post-a] %pass wire=/clay-sub/~nul/desk
%c %warp ~nul %desk ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
results3
results4
results5
results6
(expect-ford-empty ford-gate ~nul)
==
::
2018-11-29 22:56:45 +03:00
++ disabled-test-reef-slow
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
=/ hoon-parsed=hoon
(rain /~nul/base/~1234.5.6/sys/hoon/hoon hoon-scry)
2018-07-20 02:49:11 +03:00
~& %parsed-hoon
::
2018-08-23 08:39:10 +03:00
=/ arvo-parsed=hoon
(rain /~nul/base/~1234.5.6/sys/arvo/hoon arvo-scry)
2018-07-20 02:49:11 +03:00
~& %parsed-arvo
::
2018-08-23 08:39:10 +03:00
=/ zuse-parsed=hoon
(rain /~nul/base/~1234.5.6/sys/zuse/hoon zuse-scry)
2018-07-20 02:49:11 +03:00
~& %parsed-zuse
::
=/ pit=vase !>(~)
=/ hoon-compiled=vase (slap pit hoon-parsed)
~& %hoon-compiled
=/ arvo-compiled=vase (slap (slot 7 hoon-compiled) arvo-parsed)
2018-07-20 02:49:11 +03:00
~& %arvo-compiled
=/ pit-compiled=vase (slap arvo-compiled [%cnts ~[[%& 1] %is] ~])
~& %pit-compiled
=/ zuse-compiled=vase (slap pit-compiled zuse-parsed)
2018-07-20 02:49:11 +03:00
~& %zuse-compiled
::
=/ scry-results=(map [term beam] cage) (with-reef ~1234.5.6 ~)
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/reef] type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
[%reef [~nul %base]]
2018-07-20 02:49:11 +03:00
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made *] i.moves)
=/ result result.p.card.i.moves
?> ?=(%complete -.result)
?> ?=([%success %reef *] +.result)
2018-07-20 02:49:11 +03:00
::
=/ kernel=vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
%+ weld
=/ result
q:(slym (slap (slap kernel [%limb %format]) [%limb %en-beam]) *beam)
%+ expect-eq
!> (en-beam *beam)
!> result
2018-07-20 02:49:11 +03:00
::
%+ expect-eq
!> &
!> (slab %format p.kernel)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-reef-short-circuit ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
2018-08-31 02:06:27 +03:00
scry=(scry-reef ~1234.5.6)
2018-07-20 02:49:11 +03:00
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/reef] type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
[%reef [~nul %home]]
2018-07-20 02:49:11 +03:00
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made *] i.moves)
=/ result result.p.card.i.moves
?> ?=(%complete -.result)
?> ?=([%success %reef *] +.result)
2018-07-20 02:49:11 +03:00
::
=/ kernel=vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
%+ weld
=/ result
q:(slym (slap (slap kernel [%limb %format]) [%limb %en-beam]) *beam)
%+ expect-eq
!> (en-beam *beam)
!> result
2018-07-20 02:49:11 +03:00
::
%+ expect-eq
!> &
!> (slab %format p.kernel)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-path ^- tang
2018-07-20 02:49:11 +03:00
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %desk %da ~1234.5.6] /hoon/bar/foo/lib]]
`[%hoon !>(*hoon)]
::
:- [%cx [[~nul %desk %da ~1234.5.6] /hoon/foo-bar/lib]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%path disc=[~nul %desk] prefix='lib' raw-path='foo-bar']
==
::
^= moves
:~ :* duct=~[/path] %give %made ~1234.5.6 %complete
%success %path [[~nul %desk] /hoon/bar/foo/lib]
== == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-plan-hoon ^- tang
2018-07-20 02:49:11 +03:00
::
=/ =hoon (ream '`@tas`%constant')
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/plan] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
%plan
source-path=[[~nul %home] /bar/foo]
query-string=`coin`[%$ *dime]
source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
cranes=~
sources=[hoon]~
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made *] i.moves)
=/ result result.p.card.i.moves
?> ?=(%complete -.result)
?> ?=([%success %plan *] +.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>(%constant) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src '`@tas`%constant'
=/ hoon-src-type=type [%atom %$ ~]
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo-bar/lib]]
[%hoon hoon-src-type hoon-src]
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/foo-bar/lib]]
==
::
^= moves
:~ :* duct=~[/path] %give %made ~1234.5.6 %complete
%success %core [%atom %tas ~] %constant
== == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-linker ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/data/sur]]
:- %hoon
:- hoon-src-type
'''
|%
+= data-type
[msg=tape count=@ud]
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/data/lib]]
:- %hoon
:- hoon-src-type
'''
/- data
|%
++ do
|= [a=data-type:data b=data-type:data]
^- data-type:data
[(weld msg.a msg.b) (add count.a count.b)]
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/- *data
/+ combiner=data
(do:combiner `data-type`["one" 1] `data-type`["two" 2])
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>(["onetwo" 3]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-multi-hoon ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
|%
+= data-type
[msg=tape count=@ud]
--
|%
++ data
^- data-type
["one" 1]
--
data
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>(["one" 1]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fsts-fssg ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= one /~ `@u`1
/= two /~ `@u`2
(add one two)
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>(3) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fsdt-fskt ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /^ (list @ud)
/. /~ 1
/~ 2
/~ 3
==
(weld data [4 5 ~])
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([1 2 3 4 5 ~]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fskt-nest-fail ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /^ (list @u)
/~ 5
data
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= moves
:~ :* duct=~[/path] %give %made ~1234.5.6 %complete %error
2018-08-17 02:00:33 +03:00
:~ :- %leaf
"ford: %core on /~nul/home/0/gen/program/hoon failed:"
2018-07-20 02:49:11 +03:00
[%leaf "/^ failed: nest-fail"]
== == == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fssm ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /; |=(a=@u [a a ~])
/~ 5
data
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([5 5 ~]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fsbr ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /| /^ (list @u)
/~ 5
::
/^ (list @u)
/~ [6 6 ~]
==
data
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([6 6 ~]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fsbr-out-of-options ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /| /^ (list @u)
/~ 5
::
/^ @u
/~ [6 6 ~]
==
data
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= moves
:~ :* duct=~[/path] %give %made ~1234.5.6 %complete %error
2018-08-17 02:00:33 +03:00
:~ :- %leaf
"ford: %core on /~nul/home/0/gen/program/hoon failed:"
2018-07-20 02:49:11 +03:00
[%leaf "/| failed: out of options"]
== == == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-plan-fszp-as-noun ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /!noun/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/other/lib]]
:- %hoon
:- hoon-src-type
'''
[1 2 3 ~]
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
:* %plan [[~nul %home] /other/lib] *coin
:* source-rail=[[~nul %desk] /bar/foo]
zuse-version=309
structures=~
libraries=~
cranes=[%fsts %data [%fszp %noun]]~
sources=[%wing [%data]~]~
== == ==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %plan *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([1 2 3 ~]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fszp-as-mark ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /: /===/lib/other
/!somemark/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/somemark/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [word=tape num=@]
++ grab
|%
+= noun [tape @]
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/other/lib]]
:- %hoon
:- hoon-src-type
'''
["five" 5]
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
%core [[~nul %home] /hoon/program/gen]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>(["five" 5]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fscl-fszp ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /: /===/data
/!noun/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/data]]
:- %hoon
:- hoon-src-type
'''
[1 2 3 ~]
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([1 2 3 ~]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fscm ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /: /===/data
/!noun/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/data]]
:- %hoon
:- hoon-src-type
'''
/, /other
/~ a=[3 2 1 ~]
::
/data
/~ a=[1 2 3 ~]
==
a
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([1 2 3 ~]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-plan-fsbc ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/other/lib]]
:- %hoon
:- hoon-src-type
'''
/= data /$ %+ cork fuel:html
|= gas/epic:eyre
[bem.gas (~(got by qix.gas) 'key')]
data
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
:* %plan [[~nul %home] /other/lib]
:~ %many
[%blob *cred:eyre]
[%$ [%t %key]]
[%$ [%t %value]]
[%$ %n ~]
==
:* source-rail=[[~nul %home] /hoon/other/lib]
zuse-version=309
structures=~
libraries=~
cranes=[%fsts %data [%fszp %noun]]~
sources=`(list hoon)`[[%wing [%data]~] ~]
== == ==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %plan *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
%+ expect-eq
!>([[[~nul %home [%da ~1234.5.6]] /other/lib] %value])
vase
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fscb ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /^ (map @ta @ud)
/: /===/data
2018-07-20 02:49:11 +03:00
/_ /!noun/
data
'''
::
:- [%cy [[~nul %home %da ~1234.5.6] /data]]
:- %arch
:- arch-type
:- ~
(my ~[[~.one ~] [~.two ~] [~.hoon ~]])
::
:- [%cy [[~nul %home %da ~1234.5.6] /one/data]]
:- %arch
:- arch-type
:- ~
(my ~[[~.hoon ~]])
::
:- [%cy [[~nul %home %da ~1234.5.6] /two/data]]
:- %arch
:- arch-type
:- ~
(my ~[[~.hoon ~]])
::
:: this "hoon" file should be filtered out
::
:- [%cy [[~nul %home %da ~1234.5.6] /hoon/data]]
:- %arch
:- arch-type
:- fil=[~ u=0v6]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/one/data]]
:- %hoon
:- hoon-src-type
'''
1
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/two/data]]
:- %hoon
:- hoon-src-type
'''
2
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
=/ expected (my [[%one 1] [%two 2] ~])
(expect-eq !>(expected) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fspm ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- ~
:- %hoon
:- hoon-src-type
'''
/= data /&second&first&/~["four" 5 "six"]
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/first/mar]]
:- ~
:- %hoon
:- hoon-src-type
'''
|_ [word=tape num=@]
++ grab
|%
++ noun |=([a=tape b=@ c=tape] [a b])
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/second/mar]]
:- ~
:- %hoon
:- hoon-src-type
'''
|_ num=@
++ grab
|%
++ first |=([a=tape b=@] b)
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/noun/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
%core [[~nul %home] /hoon/program/gen]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
(expect-eq !>(5) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-core-fszy-renderer ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /: /===/data
/foo/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/ren]]
:- %hoon
:- hoon-src-type
'''
/= data /!noun/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/data]]
:- %hoon
:- hoon-src-type
'''
[1 2 3 ~]
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
%core [[~nul %home] /hoon/program/gen]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase vase.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([1 2 3 ~]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-bunt ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src=@ta
'''
|_ cell=^
++ grab
|%
++ noun ^
--
--
'''
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
[%hoon !>(hoon-src)]
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%bunt [~nul %home] %foo]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %bunt *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase q.cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([0 0]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-volt ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src=@ta
'''
|_ cell=^
++ grab
|%
++ noun ^
--
--
'''
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
[%hoon !>(hoon-src)]
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%volt [~nul %home] %foo [12 13]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %volt *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase q.cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([12 13]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-vale ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src=@ta
'''
|_ cell=^
++ grab
|%
++ noun ^
--
--
'''
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
[%hoon !>(hoon-src)]
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%vale [~nul %home] %foo [12 13]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %vale *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =vase q.cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-eq !>([12 13]) vase)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-vale-error ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src=@ta
'''
|_ cell=^
++ grab
|%
++ noun ^
--
--
'''
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
[%hoon !>(hoon-src)]
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%vale [~nul %home] %foo 42]
==
::
^= moves
:~ :* duct=~[/path] %give %made ~1234.5.6 %complete %error
2018-08-21 02:34:45 +03:00
:~ :- %leaf
%+ weld
"ford: %vale failed: invalid input for mark: "
"/~nul/home/~1234.5.6/mar/foo/hoon"
::
:- %leaf
"ford: %call execution failed:"
== == == ==
2018-07-20 02:49:11 +03:00
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-cast ^- tang
2018-07-20 02:49:11 +03:00
::
=/ foo-mark-src=@ta
'''
|_ cell=^
++ grab
|%
++ bar ^
--
--
'''
::
=/ bar-mark-src=@ta
'''
|_ sample=[@ @]
++ grab
|%
+= noun [@ @]
--
--
'''
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
`[%hoon hoon-src-type foo-mark-src]
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/bar/mar]]
`[%hoon hoon-src-type bar-mark-src]
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/noun/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%cast [~nul %home] %foo [%vale [~nul %home] %bar [12 13]]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %cast *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %foo !>([12 13]) cage)
==
2018-07-20 02:49:11 +03:00
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-cast-grow ^- tang
2018-07-20 02:49:11 +03:00
::
=/ foo-mark-src=@ta
'''
|_ cell=^
++ grab
|%
++ noun ^
--
--
'''
::
=/ bar-mark-src=@ta
'''
|_ sample=[@ @]
++ grab
|%
+= noun [@ @]
--
++ grow
|%
++ foo sample
--
--
'''
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
`[%hoon hoon-src-type foo-mark-src]
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/bar/mar]]
`[%hoon hoon-src-type bar-mark-src]
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/noun/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%cast [~nul %home] %foo [%vale [~nul %home] %bar [12 13]]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %cast *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %foo !>([12 13]) cage)
==
2018-07-20 02:49:11 +03:00
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-mute ^- tang
2018-07-20 02:49:11 +03:00
::
=/ atom-type=type [%atom %$ ~]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
%mute subject=[%$ %foo !>([a=42 b=[43 c=44]])]
^= mutations ^- (list [wing schematic:ford-gate])
:~
[~[%a] [%$ %noun atom-type 2]]
[~[%c %b] [%$ %noun atom-type 4]]
== ==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %mute *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %foo !>([2 43 4]) cage)
==
2018-07-20 02:49:11 +03:00
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-bake-renderer ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%+ with-reef ~1234.5.6
2018-07-20 02:49:11 +03:00
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/ren]]
:- %hoon
:- hoon-src-type
'''
/= data /!noun/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/data]]
:- %hoon
:- hoon-src-type
'''
[1 2 3 ~]
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%bake %foo *coin `rail:ford-gate`[[~nul %home] /data]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %bake *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %foo !>([1 2 3 ~]) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-bake-mark ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] (unit cage))
%+ with-reef-unit ~1234.5.6
2018-07-20 02:49:11 +03:00
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ cell=^
++ grab
|%
++ bar ^
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/bar/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ sample=[@ @]
++ grab
|%
+= noun [@ @]
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/ren]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /bar/data]]
`[%bar !>([12 13])]
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/noun/mar]]
~
::
:- [%cy [[~nul %home %da ~1234.5.6] /data]]
`[%arch !>(`arch`[fil=~ dir=(my [%bar ~]~)])]
::
:- [%cy [[~nul %home %da ~1234.5.6] /bar/data]]
`[%arch !>(`arch`[fil=`*@uv dir=~])]
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%bake %foo *coin `rail:ford-gate`[[~nul %home] /data]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
~| build-result.result
?> ?=([%success %bake *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %foo !>([12 13]) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
:: renderers can fail, and we should fall back to using the mark
::
2018-08-23 08:39:10 +03:00
++ test-bake-mark-fallback ^- tang
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] (unit cage))
%+ with-reef-unit ~1234.5.6
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/dat/ren]]
:^ ~ %hoon hoon-src-type
'''
/= data /~ !!
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/dat/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ atom=@
++ grab
|%
++ txt @
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt/mar]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /txt/data]]
:^ ~ %txt hoon-src-type
'''
one
'''
::
:- [%cy [[~nul %home %da ~1234.5.6] /data]]
`[%arch !>(`arch`[fil=~ dir=(my [%txt ~]~)])]
::
:- [%cy [[~nul %home %da ~1234.5.6] /txt/data]]
`[%arch !>(`arch`[fil=`*@uv dir=~])]
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
[%bake %dat *coin `rail:ford-gate`[[~nul %home] /data]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
=/ result result.p.card.i.moves
?> ?=([%success %bake *] build-result.result)
::
=/ =cage cage.build-result.result
::
(expect-cage %dat !>('one') cage)
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
2018-07-20 02:49:11 +03:00
::
2018-08-23 08:39:10 +03:00
++ test-diff ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
:+ %hoon hoon-src-type
'''
|_ cell=^
++ grab
|%
++ noun ^
--
++ grad
|%
++ diff |=(^ +<)
++ form %foo
--
--
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
:^ %diff [~nul %home]
[%$ %foo !>([12 13])]
[%$ %foo !>([17 18])]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %diff *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %foo !>([17 18]) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-diff-form ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ txt=wain
++ grab
|%
++ noun wain
--
++ grad
|%
++ form %txt-diff
++ diff
|= other-txt=wain
^- (urge:clay cord)
=, differ
(lusk txt other-txt (loss txt other-txt))
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt-diff/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ txt-diff=(urge:clay cord)
++ grab
|%
++ noun (urge:clay cord)
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/diff/txt/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
:^ %diff [~nul %home]
[%$ %txt !>(~[%a %b])]
[%$ %txt !>(~[%a %d])]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %diff *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %txt-diff !>(~[[%& 1] [%| ~[%b] ~[%d]]]) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-pact ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ txt=wain
++ grab
|%
++ noun wain
--
++ grad
|%
++ form %txt-diff
++ diff
|= other-txt=wain
^- (urge:clay cord)
=, differ
(lusk txt other-txt (loss txt other-txt))
++ pact
|= diff=(urge:clay cord)
^- wain
=, differ
(lurk txt diff)
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt-diff/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ txt-diff=(urge:clay cord)
++ grab
|%
++ noun (urge:clay cord)
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/diff/txt/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
:^ %pact [~nul %home]
[%$ %txt !>(~[%a %b])]
[%$ %txt-diff !>(~[[%& 1] [%| ~[%b] ~[%d]]])]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %pact *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
(expect-cage %txt !>(~[%a %d]) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-pact-mark ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ txt=wain
++ grab
|%
++ noun wain
--
++ grad
|%
++ form %txt-diff
++ diff
|= other-txt=wain
^- (urge:clay cord)
=, differ
(lusk txt other-txt (loss txt other-txt))
++ pact
|= diff=(urge:clay cord)
^- wain
=, differ
(lurk txt diff)
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/foo/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ foo=@t
++ grab
|%
++ noun @t
++ txt of-wain:format
--
++ grow
|%
++ txt (to-wain:format foo)
--
++ grad %txt
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt-diff/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ txt-diff=(urge:clay cord)
++ grab
|%
++ noun (urge:clay cord)
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/diff/txt/mar]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/noun/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
:^ %pact [~nul %home]
:+ %$ %foo !>
'''
a
b
'''
[%$ %txt-diff !>(~[[%& 1] [%| ~[%b] ~[%d]]])]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %pact *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
=/ expected '''
a
d
'''
2018-07-20 02:49:11 +03:00
::
(expect-cage %foo !>(expected) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-join ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt/mar]]
:^ ~ %hoon hoon-src-type
2018-08-23 08:39:10 +03:00
txt-scry
2018-07-20 02:49:11 +03:00
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt-diff/mar]]
:^ ~ %hoon hoon-src-type
2018-08-23 08:39:10 +03:00
diff-scry
2018-07-20 02:49:11 +03:00
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/diff/txt/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
:^ %join [~nul %home] %txt
:: replace %a with %c on the first line
::
:- [%$ %txt-diff !>(~[[%| ~[%a] ~[%c]] [%& 1]])]
:: replace %b with %d on the second line
::
[%$ %txt-diff !>(~[[%& 1] [%| ~[%b] ~[%d]]])]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
=/ result result.p.card.i.moves
?> ?=([%success %join *] build-result.result)
::
=/ =cage cage.build-result.result
::
=/ result=(urge:clay cord) ~[[%| ~[%a] ~[%c]] [%| ~[%b] ~[%d]]]
(expect-cage %txt-diff !>(result) cage)
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
++ test-join-grad ^- tang
::
=/ hoon-src-type=type [%atom %$ ~]
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt/mar]]
:^ ~ %hoon hoon-src-type
txt-scry
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt-diff/mar]]
:^ ~ %hoon hoon-src-type
diff-scry
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/diff/txt/mar]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/hoon/mar]]
:^ ~ %hoon hoon-src-type
'''
|_ foo=@t
++ grab
|%
++ noun @t
++ txt of-wain:format
--
++ grow
|%
++ txt (to-wain:format foo)
--
++ grad %txt
--
'''
==
::
=^ results1 ford-gate
%- ford-call-with-comparator :*
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
:^ %join [~nul %home] %hoon
:: replace %a with %c on the first line
2018-07-20 02:49:11 +03:00
::
:- [%$ %txt-diff !>(~[[%| ~[%a] ~[%c]] [%& 1]])]
:: replace %b with %d on the second line
::
[%$ %txt-diff !>(~[[%& 1] [%| ~[%b] ~[%d]]])]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %join *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
=/ result=(urge:clay cord) ~[[%| ~[%a] ~[%c]] [%| ~[%b] ~[%d]]]
(expect-cage %txt-diff !>(result) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-list ^- tang
2018-07-20 02:49:11 +03:00
::
=/ ud-type=type [%atom %ud ~]
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/count] type=~ %build live=%.n
2018-07-23 23:58:38 +03:00
%list
2018-07-20 02:49:11 +03:00
:~ [%$ %noun ud-type 1]
[%$ %noun ud-type 2]
[%$ %noun ud-type 3]
== ==
::
^= moves
:~ :* duct=~[/count] %give %made ~1234.5.6 %complete
%success %list
:~ [%success %$ %noun ud-type 1]
[%success %$ %noun ud-type 2]
[%success %$ %noun ud-type 3]
== == == ==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-mash ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt/mar]]
:^ ~ %hoon hoon-src-type
2018-08-23 08:39:10 +03:00
txt-scry
2018-07-20 02:49:11 +03:00
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/txt-diff/mar]]
:^ ~ %hoon hoon-src-type
2018-08-23 08:39:10 +03:00
diff-scry
2018-07-20 02:49:11 +03:00
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/diff/txt/mar]]
~
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/path] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
^- schematic:ford-gate
:- %mash
:^ [~nul %home] %txt
:: replace %a with %c on the first line
::
^= first
:+ [~nul %home] %txt-diff
^- schematic:ford-gate
[%$ %txt-diff !>(~[[%| ~[%a] ~[%c]] [%& 1]])]
:: replace %b with %d on the second line
::
^= second
:+ [~nul %home] %txt-diff
^- schematic:ford-gate
[%$ %txt-diff !>(~[[%& 1] [%| ~[%b] ~[%d]]])]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete *] i.moves)
2018-07-20 02:49:11 +03:00
=/ result result.p.card.i.moves
?> ?=([%success %mash *] build-result.result)
2018-07-20 02:49:11 +03:00
::
=/ =cage cage.build-result.result
2018-07-20 02:49:11 +03:00
::
=/ result=(urge:clay cord) ~[[%| ~[%a] ~[%c]] [%| ~[%b] ~[%d]]]
2018-07-20 02:49:11 +03:00
::
(expect-cage %txt-diff !>(result) cage)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
:: tests multiple cores depending on a rich dependency tree
::
:: Test why multiple app cores don't receive dependencies
::
2018-08-23 08:39:10 +03:00
++ test-multi-core-same-dependency ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
::
=/ scry-results=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/gh/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add sur-gh-two:gh lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/gh/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-gh-one=1 sur-gh-two=2 sur-gh-three=3]
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/plan-acct/sur]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/acct/plan/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-plan-acct=1 sur-plan-acct=2]
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/lib/old/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/old-lib/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
[old-lib-val=10 ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/parse/gh/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/gh-parse/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-gh-parse-val=(add old-lib-val sur-gh-three:gh) ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/connector/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-connector-val=(add old-lib-val sur-gh-one:gh) ~]
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/gh] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
%core [[~nul %home] /hoon/gh/app]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
?> ?=([* %give %made @da %complete %success %core *] i.moves)
::
=/ =vase vase.build-result.result.p.card.i.moves
::
%+ weld
(expect-eq !>(13) vase)
2018-07-20 02:49:11 +03:00
::
=/ files=(set [%x path])
%- sy :~
[%x /lib/old-lib/hoon]
[%x /sur/gh/hoon]
[%x /sur/plan-acct/hoon]
[%x /sur/plan/acct/hoon]
[%x /lib/old/lib/hoon]
[%x /app/gh/hoon]
[%x /lib/gh/parse/hoon]
[%x /lib/gh-parse/hoon]
[%x /lib/connector/hoon]
2018-08-31 02:06:27 +03:00
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-20 02:49:11 +03:00
==
::
%+ expect-eq
!> ^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/gh] %pass wire=/clay-sub/~nul/home/~1234.5.6
%c %warp ~nul %home
`[%mult [%da ~1234.5.6] files]
==
!> i.t.moves
2018-07-20 02:49:11 +03:00
==
:: add a gh2 app which is the same as gh; move dates forward
::
:: gh2 is the same except for adding one instead of two.
=. scry-results
%- my :~
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/gh/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add sur-gh-two:gh lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/gh2/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add sur-gh-one:gh lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/gh/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-gh-one=1 sur-gh-two=2 sur-gh-three=3]
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/plan-acct/sur]]
~
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/acct/plan/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-plan-acct=1 sur-plan-acct=2]
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/lib/old/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/old-lib/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
[old-lib-val=10 ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/parse/gh/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/gh-parse/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-gh-parse-val=(add old-lib-val sur-gh-three:gh) ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/connector/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-connector-val=(add old-lib-val sur-gh-one:gh) ~]
'''
==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.7
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/gh2] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
%core [[~nul %home] /hoon/gh2/app]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
2018-07-21 02:17:29 +03:00
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
2018-07-20 02:49:11 +03:00
?> ?=([* %give %made @da %complete %success %core *] i.moves)
::
=/ =vase vase.build-result.result.p.card.i.moves
::
%+ weld
(expect-eq !>(12) vase)
2018-07-20 02:49:11 +03:00
::
=/ files=(set [%x path])
%- sy :~
[%x /lib/old-lib/hoon]
[%x /sur/gh/hoon]
[%x /sur/plan-acct/hoon]
[%x /sur/plan/acct/hoon]
[%x /lib/old/lib/hoon]
[%x /app/gh2/hoon]
[%x /lib/gh/parse/hoon]
[%x /lib/gh-parse/hoon]
[%x /lib/connector/hoon]
2018-08-31 02:06:27 +03:00
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-20 02:49:11 +03:00
==
::
%+ expect-eq
!> ^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/gh2] %pass wire=/clay-sub/~nul/home/~1234.5.7
%c %warp ~nul %home
`[%mult [%da ~1234.5.7] files]
==
!> i.t.moves
2018-07-20 02:49:11 +03:00
==
::
:: add a gh3 app which is the same as gh; move dates forward
::
:: gh3 is the same except for adding zero instead of two.
=. scry-results
%- my :~
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/gh/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add sur-gh-two:gh lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/gh2/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add sur-gh-one:gh lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/gh3/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add 0 lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/gh/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-gh-one=1 sur-gh-two=2 sur-gh-three=3]
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/plan-acct/sur]]
~
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/acct/plan/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-plan-acct=1 sur-plan-acct=2]
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/lib/old/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/old-lib/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
[old-lib-val=10 ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/parse/gh/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/gh-parse/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-gh-parse-val=(add old-lib-val sur-gh-three:gh) ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/connector/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-connector-val=(add old-lib-val sur-gh-one:gh) ~]
'''
==
::
=^ results3 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.8
scry=(scry-with-results-and-failures scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/gh3] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
%core [[~nul %home] /hoon/gh3/app]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
2018-07-21 02:17:29 +03:00
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
2018-07-20 02:49:11 +03:00
?> ?=([* %give %made @da %complete %success %core *] i.moves)
::
=/ =vase vase.build-result.result.p.card.i.moves
::
%+ weld
(expect-eq !>(11) vase)
2018-07-20 02:49:11 +03:00
::
=/ files=(set [%x path])
%- sy :~
[%x /lib/old-lib/hoon]
[%x /sur/gh/hoon]
[%x /sur/plan-acct/hoon]
[%x /sur/plan/acct/hoon]
[%x /lib/old/lib/hoon]
[%x /app/gh3/hoon]
[%x /lib/gh/parse/hoon]
[%x /lib/gh-parse/hoon]
[%x /lib/connector/hoon]
2018-08-31 02:06:27 +03:00
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-20 02:49:11 +03:00
==
::
%+ expect-eq
!> ^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/gh3] %pass wire=/clay-sub/~nul/home/~1234.5.8
%c %warp ~nul %home
`[%mult [%da ~1234.5.8] files]
==
!> i.t.moves
2018-07-20 02:49:11 +03:00
==
::
:: change the implementation of /lib/connector/hoon
::
=. scry-results
%- my :~
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/gh/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add sur-gh-two:gh lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/gh2/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add sur-gh-one:gh lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/gh3/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/? 314
/- gh, plan-acct
/+ gh-parse, connector
::
(add 0 lib-connector-val:connector)
'''
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/gh/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-gh-one=1 sur-gh-two=2 sur-gh-three=3]
'''
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/plan-acct/sur]]
~
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/acct/plan/sur]]
:- ~
:- %hoon
:- hoon-src-type
'''
[sur-plan-acct=1 sur-plan-acct=2]
'''
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/lib/old/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/old-lib/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
[old-lib-val=10 ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/parse/gh/lib]]
~
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/gh-parse/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-gh-parse-val=(add old-lib-val sur-gh-three:gh) ~]
'''
::
:- [%cx [[~nul %home %da ~1234.5.9] /hoon/connector/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
/- gh
/+ old-lib
=, old-lib
[lib-connector-val=(add old-lib-val 5) ~]
'''
==
::
=^ results4 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.9
scry=(scry-with-results-and-failures scry-results)
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/home/~1234.5.6 duct=~[/gh]
2018-07-20 02:49:11 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.9] (sy [%x /lib/connector/hoon]~)]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
2018-07-21 02:17:29 +03:00
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
2018-07-20 02:49:11 +03:00
?> ?=([* %give %made @da %complete %success %core *] i.moves)
::
=/ =vase vase.build-result.result.p.card.i.moves
::
=/ files=(set [%x path])
%- sy :~
[%x /lib/old-lib/hoon]
[%x /sur/gh/hoon]
[%x /sur/plan-acct/hoon]
[%x /sur/plan/acct/hoon]
[%x /lib/old/lib/hoon]
[%x /app/gh/hoon]
2018-07-21 02:17:29 +03:00
[%x /lib/gh/parse/hoon]
[%x /lib/gh-parse/hoon]
[%x /lib/connector/hoon]
2018-08-31 02:06:27 +03:00
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-21 02:17:29 +03:00
==
::
;: weld
(expect-eq !>(~[/gh]) !>(duct.i.moves))
(expect-eq !>(17) vase.build-result.result.p.card.i.moves)
2018-07-21 02:17:29 +03:00
::
%+ expect-eq
!> ^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/gh] %pass wire=/clay-sub/~nul/home/~1234.5.9
%c %warp ~nul %home
`[%mult [%da ~1234.5.9] files]
==
!> i.t.moves
2018-07-21 02:17:29 +03:00
== ==
::
=^ results5 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-21 02:17:29 +03:00
ford-gate
now=~1234.5.9
scry=(scry-with-results-and-failures scry-results)
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/home/~1234.5.7 duct=~[/gh2]
2018-07-21 02:17:29 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.9] (sy [%x /lib/connector/hoon]~)]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
?> ?=([* %give %made @da %complete %success %core *] i.moves)
::
=/ =vase vase.build-result.result.p.card.i.moves
::
=/ files=(set [%x path])
%- sy :~
[%x /lib/old-lib/hoon]
[%x /sur/gh/hoon]
[%x /sur/plan-acct/hoon]
[%x /sur/plan/acct/hoon]
[%x /lib/old/lib/hoon]
2018-07-20 02:49:11 +03:00
[%x /app/gh2/hoon]
2018-07-21 02:17:29 +03:00
[%x /lib/gh/parse/hoon]
[%x /lib/gh-parse/hoon]
[%x /lib/connector/hoon]
2018-08-31 02:06:27 +03:00
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-21 02:17:29 +03:00
==
::
;: weld
(expect-eq !>(~[/gh2]) !>(duct.i.moves))
(expect-eq !>(16) vase.build-result.result.p.card.i.moves)
2018-07-21 02:17:29 +03:00
::
%+ expect-eq
!> ^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/gh2] %pass wire=/clay-sub/~nul/home/~1234.5.9
%c %warp ~nul %home
`[%mult [%da ~1234.5.9] files]
==
!> i.t.moves
2018-07-21 02:17:29 +03:00
== ==
::
=^ results6 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-take-with-comparator :*
2018-07-21 02:17:29 +03:00
ford-gate
now=~1234.5.9
scry=(scry-with-results-and-failures scry-results)
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/home/~1234.5.8 duct=~[/gh3]
2018-07-21 02:17:29 +03:00
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.9] (sy [%x /lib/connector/hoon]~)]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(2 (lent moves))
?> ?=([^ ^ ~] moves)
?> ?=([* %give %made @da %complete %success %core *] i.moves)
::
=/ =vase vase.build-result.result.p.card.i.moves
::
=/ files=(set [%x path])
%- sy :~
[%x /lib/old-lib/hoon]
[%x /sur/gh/hoon]
[%x /sur/plan-acct/hoon]
[%x /sur/plan/acct/hoon]
[%x /lib/old/lib/hoon]
2018-07-20 02:49:11 +03:00
[%x /app/gh3/hoon]
[%x /lib/gh/parse/hoon]
[%x /lib/gh-parse/hoon]
[%x /lib/connector/hoon]
2018-08-31 02:06:27 +03:00
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-20 02:49:11 +03:00
==
::
;: weld
(expect-eq !>(~[/gh3]) !>(duct.i.moves))
(expect-eq !>(15) vase.build-result.result.p.card.i.moves)
2018-07-20 02:49:11 +03:00
::
%+ expect-eq
!> ^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/gh3] %pass wire=/clay-sub/~nul/home/~1234.5.9
%c %warp ~nul %home
`[%mult [%da ~1234.5.9] files]
==
!> i.t.moves
2018-07-20 02:49:11 +03:00
== ==
::
2018-07-21 02:17:29 +03:00
=^ results7 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-21 02:17:29 +03:00
ford-gate
now=~1234.5.10
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/gh] type=~ %kill ~]
2018-07-21 02:17:29 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/gh] %pass /clay-sub/~nul/home/~1234.5.9
%c %warp ~nul %home ~
2018-07-21 02:17:29 +03:00
== == ==
::
=^ results8 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-21 02:17:29 +03:00
ford-gate
now=~1234.5.11
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/gh2] type=~ %kill ~]
2018-07-21 02:17:29 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/gh2] %pass /clay-sub/~nul/home/~1234.5.9
%c %warp ~nul %home ~
2018-07-21 02:17:29 +03:00
== == ==
::
=^ results9 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-21 02:17:29 +03:00
ford-gate
now=~1234.5.12
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/gh3] type=~ %kill ~]
2018-07-21 02:17:29 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/gh3] %pass /clay-sub/~nul/home/~1234.5.9
%c %warp ~nul %home ~
2018-07-21 02:17:29 +03:00
== == ==
::
2018-07-20 02:49:11 +03:00
;: weld
results1
results2
results3
results4
2018-07-21 02:17:29 +03:00
results5
results6
results7
results8
results9
(expect-ford-empty ford-gate ~nul)
2018-07-20 02:49:11 +03:00
==
:: tests that we can do the simple adjacent mark case, and that we use grab
:: when both available.
::
2018-08-23 08:39:10 +03:00
++ test-walk-prefer-grab ^- tang
2018-07-20 02:49:11 +03:00
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/one/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [a=tape b=@ud]
:: convert to
++ grow
|%
++ two [b a "grow"]
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/two/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [a=@ud b=tape c=type]
++ grab
|%
++ one |=([a=tape b=@ud] [b a "grab"])
--
--
'''
::
:: todo: %cy looks funny here
::
2018-07-20 02:49:11 +03:00
:: make sure we can deal with random not-hoon files in mar
:- [%cy [[~nul %home %da ~1234.5.6] /js/dummy/mar]]
:- %js
:- hoon-src-type
'''
window.onload = function()
'''
==
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results scry-results)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/walk] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
%walk [~nul %home] %one %two
==
::
^= moves
:~ ^- move:ford-gate
:* duct=~[/walk] %give %made ~1234.5.6
%complete %success %walk
[%grab %one %two]~
==
^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/walk] %pass /clay-sub/~nul/home/~1234.5.6
%c %warp ~nul %home ~ %mult [%da ~1234.5.6]
2018-07-20 02:49:11 +03:00
%- sy :~
2018-08-31 02:06:27 +03:00
[%x /mar/two/hoon]
[%x /mar/one/hoon]
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-20 02:49:11 +03:00
== == == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/walk] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/walk] %pass /clay-sub/~nul/home/~1234.5.6
%c %warp ~nul %home ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
::
2018-08-23 08:39:10 +03:00
++ test-walk-large-graph ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results large-mark-graph)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/walk] type=~ %build live=%.y
2018-07-20 02:49:11 +03:00
%walk [~nul %home] %one %four
==
::
^= moves
:~ ^- move:ford-gate
:* duct=~[/walk] %give %made ~1234.5.6
%complete %success %walk
[[%grab %one %two] [%grab %two %four] ~]
==
^- move:ford-gate
2018-12-14 03:15:20 +03:00
:* duct=~[/walk] %pass /clay-sub/~nul/home/~1234.5.6
%c %warp ~nul %home ~ %mult [%da ~1234.5.6]
2018-07-20 02:49:11 +03:00
%- sy :~
2018-08-31 02:06:27 +03:00
[%x /mar/one/hoon]
[%x /mar/two/hoon]
[%x /mar/four/hoon]
[%x /mar/five/hoon]
[%x /sys/hoon/hoon]
[%x /sys/arvo/hoon]
[%x /sys/zuse/hoon]
2018-07-20 02:49:11 +03:00
== == == ==
::
=^ results2 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/walk] type=~ %kill ~]
2018-07-20 02:49:11 +03:00
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/walk] %pass /clay-sub/~nul/home/~1234.5.6
%c %warp ~nul %home ~
2018-07-20 02:49:11 +03:00
== == ==
::
;: weld
results1
results2
(expect-ford-empty ford-gate ~nul)
==
:: +test-walk-large-graph, except we're going to shove data through it.
::
2018-08-23 08:39:10 +03:00
++ test-cast-large-graph ^- tang
2018-07-20 02:49:11 +03:00
::
=^ results1 ford-gate
2018-08-23 08:39:10 +03:00
%- ford-call-with-comparator :*
2018-07-20 02:49:11 +03:00
ford-gate
now=~1234.5.6
scry=(scry-with-results large-mark-graph)
::
^= call-args
2018-12-13 09:34:12 +03:00
:* duct=~[/large] type=~ %build live=%.n
2018-07-20 02:49:11 +03:00
[%cast [~nul %home] %four [%volt [~nul %home] %one ["one" 1]]]
==
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=([^ ~] moves)
?> ?=([* %give %made @da %complete %success %cast *] i.moves)
2018-07-20 02:49:11 +03:00
::
=/ result=cage cage.build-result.result.p.card.i.moves
2018-07-20 02:49:11 +03:00
::
(expect-cage %four !>(["grab" "one"]) result)
2018-07-20 02:49:11 +03:00
==
::
;: weld
results1
(expect-ford-empty ford-gate ~nul)
==
::
++ test-complex-live-cranes
^- tang
:: set the build-cache to 2 to force eviction
::
=^ results0 ford-gate
%- ford-call :*
ford-gate
now=~1234.5.5
scry=scry-is-forbidden
::
call-args=[duct=~[/config] type=~ %keep [2.048 0]]
moves=~
==
::
=/ hoon-src-type=type [%atom %$ ~]
=/ item-type=type -:!>([%item ''])
=/ arch-type=type -:!>(*arch)
::
=/ scry-results1=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/+ things
/= data
/^ box:things
/; |= a=(map knot item:things)
[*config:things a]
/: /===/web /_ /item/
::
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/things/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
|%
+$ box [config (map knot item)]
+$ config [%config @t]
+$ item [%item @t]
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/item/mar]]
:- ~
:- %hoon
:- hoon-src-type
'''
/+ things
|_ item:things
:: convert to
++ grab
|%
++ noun item:things
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/item/ren]]
~
::
:- [%cx [[~nul %home %da ~1234.5.6] /item/data1/web]]
:- ~
:- %item
:- item-type
[%item 'one']
::
:- [%cy [[~nul %home %da ~1234.5.6] /web]]
`[%arch !>(`arch`[fil=~ dir=(my [[%data1 ~] ~])])]
::
:- [%cy [[~nul %home %da ~1234.5.6] /data1/web]]
`[%arch !>(`arch`[fil=~ dir=(my [%item ~]~)])]
::
:- [%cy [[~nul %home %da ~1234.5.6] /item/data1/web]]
`[%arch !>(`arch`[fil=`0v1 dir=~])]
==
::
=^ results1 ford-gate
%- ford-call-with-comparator :*
ford-gate
now=~1234.5.6
scry=(scry-with-results-and-failures scry-results1)
::
^= call-args
^- [=duct type=* wrapped-task=(hobo task:able:ford-gate)]
2018-12-13 09:34:12 +03:00
:* duct=~[/app] type=~ %build live=%.y
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/app]]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(2 (lent moves))
?> ?=(^ moves)
::
?> ?=([* %give %made @da %complete *] i.moves)
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
::
=/ =vase vase.build-result.result
::
=/ result=[[%config @t] (map knot [%item @t])]
:- [%config '']
(my [%data1 [%item 'one']] ~)
::
(expect-eq !>(result) vase)
::
:: TODO: check the subscription?
==
::
=/ scry-results2=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/program/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/+ things
/= data
/^ box:things
/; |= a=(map knot item:things)
[*config:things a]
/: /===/web /_ /item/
::
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/things/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
|%
+$ box [config (map knot item)]
+$ config [%config @t]
+$ item [%item @t]
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/item/mar]]
:- ~
:- %hoon
:- hoon-src-type
'''
/+ things
|_ item:things
:: convert to
++ grab
|%
++ noun item:things
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.7] /hoon/item/ren]]
~
::
:- [%cx [[~nul %home %da ~1234.5.7] /item/data1/web]]
:- ~
:- %item
:- item-type
[%item 'one']
::
:- [%cx [[~nul %home %da ~1234.5.7] /item/data2/web]]
:- ~
:- %item
:- item-type
[%item 'two']
::
:- [%cy [[~nul %home %da ~1234.5.7] /web]]
`[%arch !>(`arch`[fil=~ dir=(my [[%data1 ~] [%data2 ~] ~])])]
::a
:- [%cy [[~nul %home %da ~1234.5.7] /data1/web]]
`[%arch !>(`arch`[fil=~ dir=(my [%item ~]~)])]
::
:- [%cy [[~nul %home %da ~1234.5.7] /data2/web]]
`[%arch !>(`arch`[fil=~ dir=(my [%item ~]~)])]
:- [%cy [[~nul %home %da ~1234.5.7] /item/data1/web]]
`[%arch !>(`arch`[fil=`0v1 dir=~])]
::
:- [%cy [[~nul %home %da ~1234.5.7] /item/data2/web]]
`[%arch !>(`arch`[fil=`0v2 dir=~])]
==
::
=^ results2 ford-gate
%- ford-take-with-comparator :*
ford-gate
now=~1234.5.7
scry=(scry-with-results-and-failures scry-results2)
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/home/~1234.5.6 duct=~[/app]
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
[%c %wris [%da ~1234.5.7] (sy [%y /web]~)]
==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(2 (lent moves))
?> ?=(^ moves)
::
?> ?=([* %give %made @da %complete *] i.moves)
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
::
=/ =vase vase.build-result.result
::
=/ result=[[%config @t] (map knot [%item @t])]
:- [%config '']
(my [%data1 [%item 'one']] [%data2 [%item 'two']] ~)
::
(expect-eq !>(result) vase)
::
:: TODO: check the subscription?
==
::
=/ scry-results3=(map [term beam] (unit cage))
%- my :~
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/program/app]]
:- ~
:- %hoon
:- hoon-src-type
'''
/+ things
/= data
/^ box:things
/; |= a=(map knot item:things)
[*config:things a]
/: /===/web /_ /item/
::
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/things/lib]]
:- ~
:- %hoon
:- hoon-src-type
'''
|%
+$ box [config (map knot item)]
+$ config [%config @t]
+$ item [%item @t]
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/item/mar]]
:- ~
:- %hoon
:- hoon-src-type
'''
/+ things
|_ item:things
:: convert to
++ grab
|%
++ noun item:things
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.8] /hoon/item/ren]]
~
::
:- [%cx [[~nul %home %da ~1234.5.8] /item/data1/web]]
:- ~
:- %item
:- item-type
[%item 'one']
::
:- [%cx [[~nul %home %da ~1234.5.8] /item/data2/web]]
:- ~
:- %item
:- item-type
[%item 'changed-two']
::
:- [%cy [[~nul %home %da ~1234.5.8] /web]]
`[%arch !>(`arch`[fil=~ dir=(my [[%data1 ~] [%data2 ~] ~])])]
::a
:- [%cy [[~nul %home %da ~1234.5.8] /data1/web]]
`[%arch !>(`arch`[fil=~ dir=(my [%item ~]~)])]
::
:- [%cy [[~nul %home %da ~1234.5.8] /data2/web]]
`[%arch !>(`arch`[fil=~ dir=(my [%item ~]~)])]
:- [%cy [[~nul %home %da ~1234.5.8] /item/data1/web]]
`[%arch !>(`arch`[fil=`0v1 dir=~])]
::
:- [%cy [[~nul %home %da ~1234.5.8] /item/data2/web]]
`[%arch !>(`arch`[fil=`0v222 dir=~])]
==
::
=^ results3 ford-gate
%- ford-take-with-comparator :*
ford-gate
now=~1234.5.7
scry=(scry-with-results-and-failures scry-results3)
::
^= take-args
2018-12-14 03:15:20 +03:00
:* wire=/clay-sub/~nul/home/~1234.5.7 duct=~[/app]
^= wrapped-sign ^- (hypo sign:ford-gate) :- *type
:* %c %wris [%da ~1234.5.8]
(sy [%x /web/data2/item] [%y /web/data2/item] ~)
== ==
::
^= comparator
|= moves=(list move:ford-gate)
^- tang
::
?> =(2 (lent moves))
?> ?=(^ moves)
::
?> ?=([* %give %made @da %complete *] i.moves)
=/ result result.p.card.i.moves
?> ?=([%success %core *] build-result.result)
::
=/ =vase vase.build-result.result
::
=/ result=[[%config @t] (map knot [%item @t])]
:- [%config '']
(my [%data1 [%item 'one']] [%data2 [%item 'changed-two']] ~)
::
(expect-eq !>(result) vase)
::
:: TODO: check the subscription?
==
::
=^ results4 ford-gate
%- ford-call :*
ford-gate
now=~1234.5.8
scry=scry-is-forbidden
::
2018-12-13 09:38:35 +03:00
call-args=[duct=~[/app] type=~ %kill ~]
::
^= moves
2018-12-14 03:15:20 +03:00
:~ :* duct=~[/app] %pass wire=/clay-sub/~nul/home/~1234.5.8
%c %warp ~nul %home ~
== == ==
::
;: weld
results0
results1
results2
results3
results4
(expect-ford-empty ford-gate ~nul)
==
2018-07-20 02:49:11 +03:00
:: |data: shared data between cases
:: +| data
++ large-mark-graph
^- (map [term beam] cage)
::
=/ hoon-src-type=type [%atom %$ ~]
=/ arch-type=type -:!>(*arch)
::
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/one/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [a=tape b=@ud]
:: convert to
++ grow
|%
++ two [b a "grow"]
++ five b
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/two/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [a=@ud b=tape c=tape]
++ grab
|%
++ one |=([a=tape b=@ud] [b a "grab"])
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/three/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [b=tape c=tape]
++ grab
|%
++ one |=([a=tape b=@ud] [a "grab"])
--
++ grow
|%
++ two
[b c]
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/four/mar]]
:- %hoon
:- hoon-src-type
'''
|_ [c=tape b=tape]
++ grab
|%
++ two
|= [a=@ud b=tape c=tape]
[c b]
--
--
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/five/mar]]
:- %hoon
:- hoon-src-type
'''
|_ a=@u
++ grab
|%
++ four
:: ignore the value entirely
|= [c=tape b=tape]
5
--
++ grow
|%
++ one
[a "empty" "grow"]
--
--
'''
==
--