2018-03-16 03:21:46 +03:00
|
|
|
/+ ford-turbo, tester
|
|
|
|
::
|
|
|
|
:- %say
|
|
|
|
|= [[now=@da eny=@ =beak] ~ ~]
|
|
|
|
:- %noun
|
|
|
|
=+ tester:tester
|
2018-05-08 01:59:39 +03:00
|
|
|
::
|
2018-05-08 02:12:07 +03:00
|
|
|
=/ test-pit=vase !>(.)
|
|
|
|
=/ ford-gate (ford-turbo test-pit)
|
2018-05-08 01:59:39 +03:00
|
|
|
::
|
2018-03-30 04:36:09 +03:00
|
|
|
|^
|
2018-05-08 00:15:24 +03:00
|
|
|
=- ((slog -) ~)
|
2018-04-30 23:11:18 +03:00
|
|
|
^- tang
|
2018-03-16 03:21:46 +03:00
|
|
|
;: weld
|
2018-05-10 23:34:25 +03:00
|
|
|
test-tear
|
2018-03-30 04:36:09 +03:00
|
|
|
test-is-schematic-live
|
|
|
|
test-date-from-schematic
|
2018-03-20 20:30:39 +03:00
|
|
|
test-unify-jugs
|
2018-05-01 00:57:32 +03:00
|
|
|
test-resource-wire-encoding
|
2018-03-20 04:03:18 +03:00
|
|
|
test-literal
|
|
|
|
test-autocons-same
|
|
|
|
test-autocons-different
|
2018-03-20 22:30:48 +03:00
|
|
|
test-scry-clay-succeed
|
|
|
|
test-scry-clay-fail
|
2018-03-21 03:37:57 +03:00
|
|
|
test-scry-clay-block
|
2018-03-22 04:27:25 +03:00
|
|
|
test-scry-clay-live
|
2018-04-24 22:57:19 +03:00
|
|
|
test-scry-clay-live-again
|
2018-05-08 23:27:21 +03:00
|
|
|
test-scry-clay-same-path
|
2018-05-08 01:04:54 +03:00
|
|
|
test-pinned-in-past
|
|
|
|
test-pinned-in-future
|
|
|
|
test-pinned-in-pin
|
2018-03-30 22:53:57 +03:00
|
|
|
test-pinned-in-live
|
2018-03-31 02:55:43 +03:00
|
|
|
test-live-build-that-blocks
|
2018-04-03 00:42:54 +03:00
|
|
|
test-live-and-once
|
2018-04-18 00:14:13 +03:00
|
|
|
test-live-two-deep
|
2018-04-24 02:17:20 +03:00
|
|
|
test-live-three-deep
|
|
|
|
test-live-triangle
|
2018-04-25 00:44:41 +03:00
|
|
|
test-live-and-pinned-triangle
|
2018-05-08 21:10:58 +03:00
|
|
|
test-call
|
|
|
|
test-call-scry-succeed
|
|
|
|
test-call-scry-fail
|
|
|
|
test-call-scry-block
|
2018-05-10 20:56:44 +03:00
|
|
|
test-call-scry-varies
|
2018-04-03 02:17:27 +03:00
|
|
|
test-slim
|
2018-05-03 00:47:24 +03:00
|
|
|
test-slit
|
|
|
|
test-slit-error
|
2018-04-05 03:11:21 +03:00
|
|
|
test-ride
|
2018-04-06 00:12:57 +03:00
|
|
|
test-ride-scry-succeed
|
2018-04-06 00:31:59 +03:00
|
|
|
test-ride-scry-fail
|
2018-04-06 00:12:57 +03:00
|
|
|
test-ride-scry-block
|
2018-04-18 00:14:13 +03:00
|
|
|
test-ride-scry-promote
|
|
|
|
test-five-oh-fora
|
2018-04-24 02:17:20 +03:00
|
|
|
test-alts
|
2018-04-25 21:16:27 +03:00
|
|
|
test-alts-and-live
|
2018-04-25 01:51:53 +03:00
|
|
|
test-double-alts
|
2018-05-01 20:55:05 +03:00
|
|
|
test-cache-reclamation-trivial
|
|
|
|
test-cache-reclamation-live-rebuild
|
|
|
|
test-cache-reclamation-live-promote
|
2018-05-02 01:33:30 +03:00
|
|
|
test-five-oh-cache-reclamation
|
2018-05-08 02:12:07 +03:00
|
|
|
test-reef
|
2018-05-10 23:34:25 +03:00
|
|
|
test-path
|
2018-05-09 02:54:29 +03:00
|
|
|
test-plan-direct-hoon
|
2018-03-16 03:21:46 +03:00
|
|
|
==
|
2018-05-10 23:34:25 +03:00
|
|
|
++ test-tear
|
|
|
|
~& %test-tear
|
|
|
|
::
|
|
|
|
;: welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ~['a' 'bc' 'de']
|
|
|
|
(tear:ford-gate 'a-bc-de')
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ~['abc']
|
|
|
|
(tear:ford-gate 'abc')
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ~['ab/c']
|
|
|
|
(tear:ford-gate 'ab/c')
|
|
|
|
==
|
|
|
|
::
|
2018-03-30 04:36:09 +03:00
|
|
|
++ test-is-schematic-live
|
2018-03-30 22:53:57 +03:00
|
|
|
~& %test-is-schematic-live
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford (ford-gate now=~1234.5.6 eny=0xdead.beef scry=scry-is-forbidden)
|
2018-03-30 04:36:09 +03:00
|
|
|
:: pinned-schematic shows a once build
|
|
|
|
::
|
|
|
|
=/ pinned-schematic=schematic:ford
|
2018-03-30 23:21:08 +03:00
|
|
|
[%pin now [%scry [%c care=%x bel=[[~nul %desk] /foo/bar]]]]
|
2018-03-30 04:36:09 +03:00
|
|
|
:: live-schematic shows a live build
|
|
|
|
::
|
|
|
|
=/ live-schematic=schematic:ford
|
2018-03-30 23:21:08 +03:00
|
|
|
[%scry [%c care=%x bel=[[~nul %desk] /baz/doo]]]
|
2018-03-30 04:36:09 +03:00
|
|
|
:: eternal-schematic shows a trivial live build
|
|
|
|
::
|
|
|
|
=/ eternal-schematic=schematic:ford
|
|
|
|
[head=[%$ %noun !>(42)] tail=[%$ %noun !>(43)]]
|
|
|
|
::
|
2018-05-01 00:57:32 +03:00
|
|
|
^- tang
|
2018-03-30 04:36:09 +03:00
|
|
|
;: welp
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
[%.y (is-schematic-live:ford live-schematic)]
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
[%.n (is-schematic-live:ford pinned-schematic)]
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
[%.y (is-schematic-live:ford [%alts ~[live-schematic pinned-schematic]])]
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
[%.y (is-schematic-live:ford eternal-schematic)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ test-date-from-schematic
|
|
|
|
~& %test-date-from-schematic
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford (ford-gate now=~1234.5.6 eny=0xdead.beef scry=scry-is-forbidden)
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
|
|
|
=/ six-schematic=schematic:ford
|
2018-03-30 23:21:08 +03:00
|
|
|
[%pin ~1234.5.6 [%scry [%c care=%x bel=[[~nul %desk] /foo/bar]]]]
|
2018-03-30 04:36:09 +03:00
|
|
|
=/ nine-schematic=schematic:ford
|
2018-03-30 23:21:08 +03:00
|
|
|
[%pin ~1234.5.9 [%scry [%c care=%x bel=[[~nul %desk] /baz/doo]]]]
|
2018-03-30 04:36:09 +03:00
|
|
|
=/ three-schematic=schematic:ford
|
2018-03-30 23:21:08 +03:00
|
|
|
[%pin ~1234.5.3 [%scry [%c care=%x bel=[[~nul %desk] /car/dor]]]]
|
2018-04-03 00:47:52 +03:00
|
|
|
%+ welp
|
2018-03-30 04:36:09 +03:00
|
|
|
%- expect-eq !>
|
|
|
|
[~1234.5.9 (date-from-schematic:ford [three-schematic nine-schematic])]
|
2018-04-03 00:47:52 +03:00
|
|
|
%- expect-eq !>
|
|
|
|
:- ~1234.5.9
|
|
|
|
%- date-from-schematic:ford
|
|
|
|
[six-schematic [%alts ~[three-schematic nine-schematic]]]
|
2018-03-16 03:21:46 +03:00
|
|
|
::
|
2018-03-20 20:30:39 +03:00
|
|
|
++ test-unify-jugs
|
|
|
|
~& %test-unify-jugs
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford (ford-gate now=~1234.5.6 eny=0xdead.beef scry=scry-is-forbidden)
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-03-20 20:30:39 +03:00
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- ^- (jug @tas @ud)
|
|
|
|
(my ~[[%a (sy 1 2 ~)] [%b (sy 3 4 5 6 ~)] [%c (sy 7 8 ~)]])
|
2018-03-20 20:30:39 +03:00
|
|
|
::
|
2018-05-08 00:15:24 +03:00
|
|
|
%+ unify-jugs:ford
|
|
|
|
`(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-03-20 20:30:39 +03:00
|
|
|
::
|
2018-05-01 00:57:32 +03:00
|
|
|
++ test-resource-wire-encoding
|
|
|
|
~& %test-resource-wire-encoding
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford (ford-gate now=~1234.5.6 eny=0xdead.beef scry=scry-is-forbidden)
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-03-21 01:39:22 +03:00
|
|
|
;: welp
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:31:24 +03:00
|
|
|
:_ `path`(scry-request-to-path:ford [%c care=%x [[~nul %desk [%da ~1234.5.6]] /foo/bar]])
|
|
|
|
/cx/~nul/desk/~1234.5.6/bar/foo
|
2018-03-21 01:39:22 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:31:24 +03:00
|
|
|
:_ `scry-request:ford`[%c care=%x [[~nul %desk [%da ~1234.5.6]] /foo/bar]]
|
|
|
|
(need (path-to-scry-request:ford /cx/~nul/desk/~1234.5.6/bar/foo))
|
2018-03-21 01:39:22 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ ^- path
|
2018-05-08 00:31:24 +03:00
|
|
|
(scry-request-to-path:ford [%g care=%x [[~nul %desk [%da ~1234.5.6]] /foo/bar]])
|
|
|
|
/gx/~nul/desk/~1234.5.6/bar/foo
|
2018-03-21 01:39:22 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:31:24 +03:00
|
|
|
:_ ^- scry-request:ford
|
|
|
|
[%g care=%x [[~nul %desk [%da ~1234.5.6]] /foo/bar]]
|
|
|
|
(need (path-to-scry-request:ford /gx/~nul/desk/~1234.5.6/bar/foo))
|
2018-03-21 01:39:22 +03:00
|
|
|
==
|
|
|
|
::
|
2018-03-20 04:03:18 +03:00
|
|
|
++ test-literal
|
|
|
|
~& %test-literal
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: send a pinned literal, expects a %made response with pinned literal
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
[duct=~ type=~ %make ~nul [%pin ~1234.5.6 [%$ %noun !>(**)]]]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6
|
2018-05-01 00:57:32 +03:00
|
|
|
%complete %success %pin ~1234.5.6 %success %$ %noun !>(**)
|
2018-05-01 00:19:58 +03:00
|
|
|
== ==
|
2018-03-19 21:23:04 +03:00
|
|
|
==
|
2018-03-20 04:03:18 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
%+ welp
|
|
|
|
results1
|
2018-04-28 02:30:09 +03:00
|
|
|
(expect-ford-empty ford ~nul)
|
2018-03-20 04:03:18 +03:00
|
|
|
::
|
|
|
|
++ test-autocons-same
|
|
|
|
~& %test-autocons-same
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
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
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%pin ~1234.5.6 [%$ %noun !>(**)] [%$ %noun !>(**)]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %pin ~1234.5.6 %success
|
|
|
|
[%success %$ %noun !>(**)]
|
|
|
|
[%success %$ %noun !>(**)]
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-03-20 04:03:18 +03:00
|
|
|
%+ welp
|
2018-05-01 00:19:58 +03:00
|
|
|
results1
|
2018-04-28 02:30:09 +03:00
|
|
|
(expect-ford-empty ford ~nul)
|
2018-03-20 04:03:18 +03:00
|
|
|
::
|
|
|
|
++ test-autocons-different
|
|
|
|
~& %test-autocons-different
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: if we autocons different schematics, we get different values
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%pin ~1234.5.6 [%$ %noun !>(42)] [%$ %noun !>(43)]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %pin ~1234.5.6 %success
|
|
|
|
[%success %$ %noun !>(42)]
|
|
|
|
[%success %$ %noun !>(43)]
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-03-20 04:03:18 +03:00
|
|
|
%+ welp
|
2018-05-01 00:19:58 +03:00
|
|
|
results1
|
|
|
|
(expect-ford-empty ford ~nul)
|
2018-03-20 22:01:49 +03:00
|
|
|
::
|
2018-03-20 22:30:48 +03:00
|
|
|
++ test-scry-clay-succeed
|
|
|
|
~& %test-scry-clay-succeed
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
|
|
|
|
:: test a pinned scry which succeeds
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%pin ~1234.5.6 [%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
|
|
|
|
[%pin ~1234.5.6 %success [%scry %noun !>(42)]]
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-03-20 22:01:49 +03:00
|
|
|
::
|
|
|
|
%+ welp
|
2018-05-01 00:19:58 +03:00
|
|
|
results1
|
2018-04-28 02:30:09 +03:00
|
|
|
(expect-ford-empty ford ~nul)
|
2018-03-20 22:30:48 +03:00
|
|
|
::
|
|
|
|
++ test-scry-clay-fail
|
|
|
|
~& %test-scry-clay-fail
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-fail ~1234.5.6)
|
|
|
|
:: attempting to scry a path which fails should produce an error
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%pin ~1234.5.6 [%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %pin ~1234.5.6 %error
|
2018-05-01 00:19:58 +03:00
|
|
|
:~ leaf+"scry failed for"
|
|
|
|
leaf+"%cx /~nul/desk/~1234.5.6/foo/bar"
|
|
|
|
== == == ==
|
|
|
|
::
|
|
|
|
%+ weld
|
|
|
|
results1
|
|
|
|
(expect-ford-empty ford ~nul)
|
2018-03-21 01:39:22 +03:00
|
|
|
::
|
2018-03-21 03:37:57 +03:00
|
|
|
++ test-scry-clay-block
|
|
|
|
~& %test-scry-clay-block
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-block ~1234.5.6)
|
|
|
|
:: when we scry on a blocked path, expect a subscription move
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%pin ~1234.5.6 [%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass
|
2018-05-08 00:31:24 +03:00
|
|
|
wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
%c %warp [~nul ~nul] %desk
|
2018-05-01 23:56:24 +03:00
|
|
|
~ %sing %x [%da ~1234.5.6] /foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-03-21 03:37:57 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: when clay responds, send a %made
|
|
|
|
::
|
|
|
|
^= take-args
|
2018-05-08 00:31:24 +03:00
|
|
|
:* wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
|
2018-05-01 00:19:58 +03:00
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
|
|
|
|
[%pin ~1234.5.6 %success [%scry %noun !>(42)]]
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-03-21 03:37:57 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: welp
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-03-22 04:27:25 +03:00
|
|
|
::
|
|
|
|
++ test-scry-clay-live
|
|
|
|
~& %test-scry-clay-live
|
2018-03-30 04:36:09 +03:00
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
2018-03-22 04:27:25 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
|
2018-05-01 00:19:58 +03:00
|
|
|
[%scry %noun !>(42)]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-03-22 04:27:25 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=(scry-succeed ~1234.5.7 [%noun !>(43)])
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
2018-03-30 04:36:09 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~ %give %made ~1234.5.7 %complete %success
|
2018-05-01 00:19:58 +03:00
|
|
|
[%scry %noun !>(43)]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-03-31 02:55:43 +03:00
|
|
|
::
|
2018-04-24 22:57:19 +03:00
|
|
|
++ test-scry-clay-live-again
|
|
|
|
~& %test-scry-clay-live-again
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
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
|
|
|
|
:* duct=~[/first] type=~ %make ~nul
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
2018-04-24 22:57:19 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~[/first] %give %made ~1234.5.6 %complete %success
|
2018-05-01 00:19:58 +03:00
|
|
|
[%scry %noun !>(42)]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-04-24 22:57:19 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: a second scry from a different duct shouldn't resubscribe
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/second] type=~ %make ~nul
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~[/second] %give %made ~1234.5.7 %complete %success
|
2018-05-01 00:19:58 +03:00
|
|
|
[%scry %noun !>(42)]
|
|
|
|
== == ==
|
2018-04-24 22:57:19 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/first] type=~ %kill ~nul]
|
|
|
|
moves=~
|
2018-04-24 22:57:19 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/second] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
2018-04-24 22:57:19 +03:00
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
2018-05-01 00:19:58 +03:00
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-24 22:57:19 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-05-08 23:27:21 +03:00
|
|
|
:: 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.
|
|
|
|
::
|
|
|
|
++ test-scry-clay-same-path
|
|
|
|
~& %test-scry-clay-same-path
|
|
|
|
::
|
|
|
|
=/ scry-type=type [%atom %tas ~]
|
|
|
|
::
|
|
|
|
=/ blocks=(set @da) (sy ~1234.5.7 ~1234.5.8 ~)
|
|
|
|
::
|
|
|
|
=/ ford *ford-gate
|
|
|
|
::
|
|
|
|
=/ scry-schematic=schematic:ford
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
|
|
|
=/ autocons=schematic:ford
|
|
|
|
[[%pin ~1234.5.7 scry-schematic] [%pin ~1234.5.8 scry-schematic]]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-blocks blocks)
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/first] type=~ %make ~nul autocons]
|
|
|
|
::
|
|
|
|
^= expected-moves
|
|
|
|
:~ :* duct=~ %pass
|
|
|
|
wire=/~nul/scry-request/cx/~nul/desk/~1234.5.7/foo/bar
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%sing %x [%da ~1234.5.7] /foo/bar]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass
|
|
|
|
wire=/~nul/scry-request/cx/~nul/desk/~1234.5.8/foo/bar
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%sing %x [%da ~1234.5.8] /foo/bar]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=(scry-blocks blocks)
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/scry-request/cx/~nul/desk/~1234.5.7/foo/bar duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%c %writ ~ [%x [%da ~1234.5.7] %desk] /bar/foo %noun scry-type %seven]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
expected-moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=(scry-blocks blocks)
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/scry-request/cx/~nul/desk/~1234.5.8/foo/bar duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%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 %pin ~1234.5.7 %success %scry %noun scry-type %seven]
|
|
|
|
[%success %pin ~1234.5.8 %success %scry %noun scry-type %eight]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/first] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-24 22:57:19 +03:00
|
|
|
::
|
2018-05-08 01:04:54 +03:00
|
|
|
++ test-pinned-in-past
|
|
|
|
~& %test-pinned-in-past
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-08 01:04:54 +03:00
|
|
|
=/ schematic [%pin ~1234.5.5 [%$ %noun !>(42)]]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/pin] type=~ %make ~nul schematic]
|
|
|
|
::
|
|
|
|
^= expected-moves
|
|
|
|
:~ :* duct=~[/pin] %give %made ~1234.5.5 %complete
|
|
|
|
%success %pin ~1234.5.5 %success %$ %noun !>(42)
|
|
|
|
== == ==
|
|
|
|
results1
|
|
|
|
::
|
|
|
|
++ test-pinned-in-future
|
|
|
|
~& %test-pinned-in-future
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-08 01:04:54 +03:00
|
|
|
=/ schematic [%pin ~1234.5.7 [%$ %noun !>(42)]]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/pin] type=~ %make ~nul schematic]
|
|
|
|
::
|
|
|
|
^= expected-moves
|
|
|
|
:~ :* duct=~[/pin] %give %made ~1234.5.7 %complete
|
|
|
|
%success %pin ~1234.5.7 %success %$ %noun !>(42)
|
|
|
|
== == ==
|
|
|
|
results1
|
|
|
|
::
|
|
|
|
++ test-pinned-in-pin
|
|
|
|
~& %test-pinned-in-pin
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-08 01:04:54 +03:00
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-succeed ~1234.5.8 [%noun !>(42)])
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/pinned-in-future] type=~ %make ~nul
|
|
|
|
%pin ~1234.5.7
|
|
|
|
%pin ~1234.5.8
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/pinned-in-future]
|
|
|
|
%give %made ~1234.5.8 %complete
|
|
|
|
%success %pin ~1234.5.7
|
|
|
|
%success %pin ~1234.5.8
|
|
|
|
[%success %scry %noun !>(42)]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
2018-03-30 22:53:57 +03:00
|
|
|
++ test-pinned-in-live
|
|
|
|
~& %test-pinned-in-live
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
2018-03-30 22:53:57 +03:00
|
|
|
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
|
|
|
|
=/ scry-43 (scry-succeed ~1234.5.7 [%noun !>(43)])
|
|
|
|
::
|
|
|
|
=/ schematic=schematic:ford
|
|
|
|
:* %same %pin ~1234.5.6
|
2018-03-30 23:21:08 +03:00
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
2018-03-30 22:53:57 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
2018-03-30 22:53:57 +03:00
|
|
|
=/ build=build:ford [~1234.5.6 schematic]
|
|
|
|
=/ result=build-result:ford
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success %same %success %pin ~1234.5.6 %success [%scry %noun !>(42)]]
|
2018-03-30 22:53:57 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-42
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %make ~nul schematic]
|
|
|
|
moves=[duct=~ %give %made ~1234.5.6 %complete result]~
|
|
|
|
==
|
2018-03-30 22:53:57 +03:00
|
|
|
::
|
2018-05-01 00:29:40 +03:00
|
|
|
=/ results2=tang
|
2018-03-30 22:53:57 +03:00
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ results:(~(got by state-by-ship.+>+<.ford) ~nul)
|
2018-03-30 22:53:57 +03:00
|
|
|
%- my :~
|
2018-03-30 23:21:08 +03:00
|
|
|
:- [~1234.5.6 [%scry %c care=%x rail=[[~nul %desk] /bar/foo]]]
|
2018-05-01 00:57:32 +03:00
|
|
|
[%value ~1234.5.6 %success %scry %noun !>(42)]
|
2018-03-30 22:53:57 +03:00
|
|
|
::
|
|
|
|
:- :* ~1234.5.6 %pin ~1234.5.6
|
2018-03-30 23:21:08 +03:00
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
2018-03-30 22:53:57 +03:00
|
|
|
==
|
2018-05-01 00:57:32 +03:00
|
|
|
[%value ~1234.5.6 %success %pin ~1234.5.6 %success %scry %noun !>(42)]
|
2018-03-30 22:53:57 +03:00
|
|
|
::
|
|
|
|
:- :* ~1234.5.6 %same %pin ~1234.5.6
|
2018-03-30 23:21:08 +03:00
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
2018-03-30 22:53:57 +03:00
|
|
|
==
|
2018-05-01 00:57:32 +03:00
|
|
|
:* %value ~1234.5.6 %success %same %success %pin ~1234.5.6
|
|
|
|
%success %scry %noun !>(42)
|
2018-03-30 22:53:57 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %kill ~nul]
|
|
|
|
moves=~
|
|
|
|
==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-03-23 21:53:38 +03:00
|
|
|
::
|
2018-03-31 02:55:43 +03:00
|
|
|
++ test-live-build-that-blocks
|
|
|
|
~& %test-live-build-that-blocks
|
|
|
|
::
|
|
|
|
=/ scry-blocked (scry-block ~1234.5.6)
|
|
|
|
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
|
|
|
|
=/ scry-43 (scry-succeed ~1234.5.7 [%noun !>(43)])
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-blocked
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
2018-03-31 02:55:43 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass
|
2018-05-08 00:31:24 +03:00
|
|
|
wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
%c %warp [~nul ~nul] %desk
|
2018-05-01 23:56:24 +03:00
|
|
|
~ %sing %x [%da ~1234.5.6] /foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-43
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
2018-04-03 00:47:52 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-42
|
|
|
|
::
|
|
|
|
^= take-args
|
2018-05-08 00:31:24 +03:00
|
|
|
:* wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
|
2018-05-01 00:19:58 +03:00
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
|
2018-05-01 00:19:58 +03:00
|
|
|
[%scry %noun !>(42)]
|
|
|
|
==
|
2018-05-01 00:57:32 +03:00
|
|
|
:* duct=~ %give %made ~1234.5.7 %complete %success
|
2018-05-01 00:19:58 +03:00
|
|
|
[%scry %noun !>(43)]
|
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-03-31 02:55:43 +03:00
|
|
|
::
|
2018-04-03 00:42:54 +03:00
|
|
|
++ test-live-and-once
|
|
|
|
~& %test-live-and-once
|
|
|
|
::
|
|
|
|
=/ scry-blocked (scry-block ~1234.5.6)
|
|
|
|
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
|
|
|
|
::
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-blocked
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/live] type=~ %make ~nul
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
2018-04-03 00:42:54 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass
|
2018-05-08 00:31:24 +03:00
|
|
|
wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
%c %warp [~nul ~nul] %desk
|
2018-05-01 23:56:24 +03:00
|
|
|
~ %sing %x [%da ~1234.5.6] /foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-04-03 00:42:54 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-blocked
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/once] type=~ %make ~nul
|
|
|
|
[%pin ~1234.5.6 [%scry %c ren=%x rail=[[~nul %desk] /bar/foo]]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
moves=~
|
2018-04-03 00:42:54 +03:00
|
|
|
==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
^= take-args
|
2018-05-08 00:31:24 +03:00
|
|
|
:* wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
|
2018-05-01 00:19:58 +03:00
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
|
2018-04-03 00:47:52 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/live] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%scry %noun !>(42)]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~[/once] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%pin ~1234.5.6 %success [%scry %noun !>(42)]]]
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/live] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-03 00:47:52 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-03 00:42:54 +03:00
|
|
|
::
|
2018-04-18 00:14:13 +03:00
|
|
|
++ test-live-two-deep
|
|
|
|
~& %test-live-two-deep
|
|
|
|
::
|
|
|
|
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
|
|
|
|
=/ scry-43 (scry-succeed ~1234.5.7 [%noun !>(43)])
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-42
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%same [%scry %c care=%x rail=[[~nul %desk] /bar/foo]]]
|
2018-04-18 00:14:13 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
|
|
|
|
%same %success [%scry %noun !>(42)]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-43
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
2018-04-18 00:14:13 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~ %give %made ~1234.5.7 %complete %success
|
|
|
|
%same %success [%scry %noun !>(43)]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-04-24 02:17:20 +03:00
|
|
|
++ test-live-three-deep
|
|
|
|
~& %test-live-three-deep
|
|
|
|
::
|
|
|
|
=/ 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)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '`@tas`%constant')
|
|
|
|
=/ subject-schematic=schematic:ford [%scry %c %x [~nul %desk] /bar/foo]
|
|
|
|
::
|
|
|
|
=/ ride=schematic:ford [%ride formula subject-schematic]
|
|
|
|
=/ same=schematic:ford [%same ride]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %make ~nul same]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%same [%success [%ride scry-type %constant]]]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
2018-04-24 02:17:20 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
|
|
|
++ test-live-triangle
|
|
|
|
~& %test-live-triangle
|
|
|
|
::
|
|
|
|
=/ 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)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '`@tas`%constant')
|
|
|
|
=/ subject-schematic=schematic:ford [%scry %c %x [~nul %desk] /bar/foo]
|
|
|
|
::
|
|
|
|
=/ ride-type=type [%atom %tas ~]
|
|
|
|
=/ ride=schematic:ford [%ride formula subject-schematic]
|
|
|
|
=/ autocons=schematic:ford [ride subject-schematic]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %make ~nul autocons]
|
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete %success
|
|
|
|
[%success [%ride ride-type %constant]]
|
|
|
|
[%success [%scry %noun !>(%it-does-in-fact-matter)]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
2018-04-24 02:17:20 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~[/ride] %give %made ~1234.5.7 %complete %success
|
|
|
|
[%success [%ride ride-type %constant]]
|
|
|
|
[%success [%scry %noun !>(%changed)]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-24 22:57:19 +03:00
|
|
|
:: like +test-live-triangle, but with another pinned build
|
|
|
|
::
|
2018-04-25 00:44:41 +03:00
|
|
|
:: Ensures that we deal with various issues with live builds which
|
|
|
|
:: were partially pinned and their interaction with other live builds.
|
2018-04-24 22:57:19 +03:00
|
|
|
::
|
|
|
|
++ test-live-and-pinned-triangle
|
|
|
|
~& %test-live-and-pinned-triangle
|
|
|
|
::
|
|
|
|
=/ 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-does-in-fact-matter]
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %desk %da ~1234.5.7] /bar/foo]]
|
|
|
|
[%noun scry-type %it-does-in-fact-matter]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=/ scry (scry-with-results scry-results)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-24 22:57:19 +03:00
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '`@tas`%constant')
|
|
|
|
=/ subject-schematic=schematic:ford [%scry %c %x [~nul %desk] /bar/foo]
|
|
|
|
::
|
|
|
|
=/ ride-type=type [%atom %tas ~]
|
|
|
|
=/ ride=schematic:ford [%ride formula subject-schematic]
|
|
|
|
=/ autocons=schematic:ford [ride subject-schematic]
|
|
|
|
::
|
|
|
|
=/ static=schematic:ford [%same [%pin ~1234.5.6 autocons]]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/static] type=~ %make ~nul static]
|
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* duct=~[/static] %give %made ~1234.5.6 %complete %success
|
|
|
|
%same %success %pin ~1234.5.6 %success
|
|
|
|
[%success [%ride ride-type %constant]]
|
|
|
|
[%success [%scry %noun scry-type %it-does-in-fact-matter]]
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-04-25 00:44:41 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/autocons] type=~ %make ~nul autocons]
|
|
|
|
::
|
|
|
|
^= moves
|
2018-05-01 00:57:32 +03:00
|
|
|
:~ :* 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-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
2018-04-25 00:44:41 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/static] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
2018-04-25 00:44:41 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/autocons] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-25 00:44:41 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-08 21:10:58 +03:00
|
|
|
++ test-call
|
|
|
|
~& %test-call
|
2018-05-08 21:15:47 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-08 21:10:58 +03:00
|
|
|
::
|
|
|
|
=/ sample-schematic=schematic:ford [%$ %noun !>(5)]
|
|
|
|
=/ gate-schematic=schematic:ford [%$ %noun !>(|=(a=@ud +(a)))]
|
|
|
|
=/ call-schematic=schematic:ford [%call gate-schematic sample-schematic]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/call] type=~ %make ~nul call-schematic]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 21:15:47 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-08 21:10:58 +03:00
|
|
|
^- tang
|
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
|
|
|
?> ?=([* %give %made @da %complete %success %call *] i.moves)
|
|
|
|
::
|
|
|
|
=/ result=vase |7:i.moves
|
|
|
|
::
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
[6 q.result]
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- &
|
|
|
|
(~(nest ut p.result) | -:!>(*@ud))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/call] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ test-call-scry-succeed
|
|
|
|
~& %test-call-scry-succeed
|
|
|
|
::
|
|
|
|
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
|
2018-05-08 21:15:47 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-08 21:10:58 +03:00
|
|
|
::
|
|
|
|
=/ sample-schematic=schematic:ford [%$ %noun !>(24)]
|
|
|
|
=/ gate-schematic=schematic:ford
|
|
|
|
[%$ %noun !>(|=(a=@ud .^(@ud %cx /~nul/desk/~1234.5.6/foo/bar)))]
|
|
|
|
=/ call-schematic=schematic:ford [%call gate-schematic sample-schematic]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-42
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/call] type=~ %make ~nul call-schematic]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 21:15:47 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-08 21:10:58 +03:00
|
|
|
^- tang
|
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
|
|
|
?> ?=([* %give %made @da %complete %success %call *] i.moves)
|
|
|
|
::
|
|
|
|
=/ result=vase |7:i.moves
|
|
|
|
::
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
[42 q.result]
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- &
|
|
|
|
(~(nest ut p.result) | -:!>(*@ud))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/call] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
++ test-call-scry-fail
|
|
|
|
~& %test-call-scry-fail
|
|
|
|
::
|
|
|
|
=/ scry-failed (scry-fail ~1234.5.6)
|
2018-05-08 21:15:47 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-08 21:10:58 +03:00
|
|
|
::
|
|
|
|
=/ sample-schematic=schematic:ford [%$ %noun !>(24)]
|
|
|
|
=/ gate-schematic=schematic:ford
|
|
|
|
[%$ %noun !>(|=(a=@ud .^(@ud %cx /~nul/desk/~1234.5.6/foo/bar)))]
|
|
|
|
=/ call-schematic=schematic:ford [%call gate-schematic sample-schematic]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-failed
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/dead] type=~ %make ~nul call-schematic]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 21:15:47 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-08 21:10:58 +03:00
|
|
|
^- tang
|
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
|
|
|
?> ?=([* %give %made @da %complete %error *] i.moves)
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:: compare the move to the expected move, omitting check on stack trace
|
|
|
|
::
|
|
|
|
:_ i.moves(|7 ~)
|
|
|
|
:* duct=~[/dead] %give %made ~1234.5.6 %complete
|
|
|
|
[%error [leaf+"ford: %call failed:" ~]]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/dead] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
::
|
|
|
|
++ test-call-scry-block
|
|
|
|
~& %test-call-scry-block
|
|
|
|
::
|
|
|
|
=/ scry-blocked (scry-block ~1234.5.6)
|
2018-05-08 21:15:47 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-08 21:10:58 +03:00
|
|
|
::
|
|
|
|
=/ sample-schematic=schematic:ford [%$ %noun !>(24)]
|
|
|
|
=/ gate-schematic=schematic:ford
|
|
|
|
[%$ %noun !>(|=(a=@ud .^(@ud %cx /~nul/desk/~1234.5.6/foo/bar)))]
|
|
|
|
=/ call-schematic=schematic:ford [%call gate-schematic sample-schematic]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-blocked
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/live] type=~ %make ~nul call-schematic]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass
|
|
|
|
wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
~ %sing %x [%da ~1234.5.6] /foo/bar
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-blocked
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 21:15:47 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-08 21:10:58 +03:00
|
|
|
^- tang
|
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
|
|
|
?> ?=([* %give %made @da %complete %success %call *] i.moves)
|
|
|
|
::
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:: compare the move to the expected move, omitting vase type checking
|
|
|
|
::
|
|
|
|
:: Types can't be compared using simple equality, so normalize the
|
|
|
|
:: type to check the rest of the move.
|
|
|
|
::
|
|
|
|
:_ i.moves(&8 *type)
|
|
|
|
:* duct=~[/live] %give %made ~1234.5.6 %complete
|
|
|
|
[%success [%call *type 42]]
|
|
|
|
==
|
|
|
|
:: make sure the types nest
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- &
|
|
|
|
(~(nest ut &8:i.moves) | -:!>(*@))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/live] type=~ %kill ~nul]
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-05-10 20:56:44 +03:00
|
|
|
:: +test-call-scry-varies: call with an argument which varies
|
2018-05-10 00:05:43 +03:00
|
|
|
::
|
|
|
|
:: 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-05-10 20:56:44 +03:00
|
|
|
++ test-call-scry-varies
|
|
|
|
~& %test-call-scry-varies
|
2018-05-10 00:05:43 +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)
|
|
|
|
=/ ford *ford-gate
|
|
|
|
::
|
|
|
|
=/ sample-schematic=schematic:ford
|
|
|
|
[%scry [%c care=%x bel=[[~nul %desk] /timer]]]
|
|
|
|
=/ gate-schematic=schematic:ford
|
|
|
|
[%$ %noun !>(|=(a=@da .^(@tas %cx /~nul/desk/(scot %da a)/result)))]
|
|
|
|
=/ call-schematic=schematic:ford [%call gate-schematic sample-schematic]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
[duct=~[/call] type=~ %make ~nul call-schematic]
|
|
|
|
::
|
|
|
|
^= comparator
|
|
|
|
|= moves=(list move:ford-gate)
|
|
|
|
^- tang
|
|
|
|
::
|
|
|
|
?> =(2 (lent moves))
|
|
|
|
?> ?=([^ ^ ~] moves)
|
|
|
|
?> ?=([* %give %made @da %complete %success %call *] i.moves)
|
|
|
|
:: compare the move to the expected move, omitting vase type checking
|
|
|
|
::
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
:_ i.moves(&8 *type)
|
|
|
|
:* duct=~[/call] %give %made ~1234.5.6 %complete %success
|
|
|
|
%call *type %first
|
|
|
|
==
|
|
|
|
:: make sure the types nest
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
:- &
|
|
|
|
(~(nest ut &8:i.moves) | -:!>(*@tas))
|
|
|
|
:: make sure the other move is a subscription
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:_ i.t.moves
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /timer] ~)]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *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)
|
|
|
|
:: compare the move to the expected move, omitting vase type checking
|
|
|
|
::
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
:_ i.moves(&8 *type)
|
|
|
|
:* duct=~[/call] %give %made ~1234.5.7 %complete %success
|
|
|
|
%call *type %second
|
|
|
|
==
|
|
|
|
:: make sure the types nest
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
:- &
|
|
|
|
(~(nest ut &8:i.moves) | -:!>(*@tas))
|
|
|
|
:: make sure the other move is a subscription
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:_ i.t.moves
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /timer] ~)]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/call] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-05-08 21:10:58 +03:00
|
|
|
::
|
2018-04-03 02:17:27 +03:00
|
|
|
++ test-slim
|
|
|
|
~& %test-slim
|
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '(add 2 2)')
|
|
|
|
=/ subject-type=type -:!>(.)
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/dead] type=~ %make ~nul [%slim subject-type formula]]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/dead] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%slim (~(mint ut subject-type) [%noun formula])]]
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-04-03 02:17:27 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/dead] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
2018-04-03 02:17:27 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-03 02:17:27 +03:00
|
|
|
::
|
2018-05-03 00:47:24 +03:00
|
|
|
++ test-slit
|
|
|
|
~& %test-slit
|
|
|
|
::
|
|
|
|
=/ gate=vase (ride %noun '|=(a=@ud ["one" a])')
|
|
|
|
=/ sample=vase !>(42)
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-03 00:47:24 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/slit] type=~ %make ~nul [%slit gate sample]]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-03 00:47:24 +03:00
|
|
|
^- 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 !>
|
2018-05-08 21:10:58 +03:00
|
|
|
:- &
|
|
|
|
(~(nest ut actual-type) | expected-type)
|
2018-05-03 00:47:24 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/slit] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ test-slit-error
|
|
|
|
~& %test-slit-error
|
|
|
|
::
|
|
|
|
=/ gate=vase (ride %noun '|=(a=@ud ["one" a])')
|
|
|
|
=/ sample=vase !>("a tape instead of @ud")
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-03 00:47:24 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/slit] type=~ %make ~nul [%slit gate sample]]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-03 00:47:24 +03:00
|
|
|
^- 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 !>
|
|
|
|
:_ messages
|
|
|
|
:~ [%palm ["." "-" "" ""] [%leaf "have"] [%leaf "\"\""] ~]
|
|
|
|
:~ %palm ["." "-" "" ""]
|
|
|
|
[%leaf "want"]
|
|
|
|
[%palm ["/" "" "" ""] [%leaf "a"] [%leaf "@ud"] ~]
|
|
|
|
==
|
|
|
|
[%leaf "%slit failed: "]
|
|
|
|
[%leaf "nest-fail"]
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/slit] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
2018-04-06 00:12:57 +03:00
|
|
|
++ test-ride
|
2018-04-05 03:11:21 +03:00
|
|
|
~& %test-ride
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-05 03:11:21 +03:00
|
|
|
::
|
|
|
|
=/ fun |=(a=@ (add 2 a))
|
|
|
|
=/ formula=hoon (ream '!: (fun 3)')
|
|
|
|
=/ subject-schematic=schematic:ford [%$ %noun !>(.)]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/dead] type=~ %make ~nul
|
|
|
|
[%ride formula subject-schematic]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-01 00:29:40 +03:00
|
|
|
^- tang
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
2018-05-01 00:57:32 +03:00
|
|
|
?> ?=([* %give %made @da %complete %success %ride *] i.moves)
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
:: compare the move to the expected move, omitting vase type checking
|
|
|
|
::
|
|
|
|
:: Types can't be compared using simple equality, so normalize the
|
|
|
|
:: type to check the rest of the move.
|
|
|
|
::
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ i.moves(&8 *type)
|
2018-05-01 00:19:58 +03:00
|
|
|
:* duct=~[/dead] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%ride *type 5]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:: make sure the returned type nests
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- &
|
|
|
|
(~(nest ut &8:i.moves) | -:!>(*@))
|
2018-04-05 03:11:21 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/dead] type=~ %kill ~nul]
|
|
|
|
moves=~
|
2018-04-05 03:11:21 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-05 03:11:21 +03:00
|
|
|
::
|
2018-04-06 00:12:57 +03:00
|
|
|
++ test-ride-scry-succeed
|
|
|
|
~& %test-ride-scry-succeed
|
|
|
|
::
|
|
|
|
=/ scry-42 (scry-succeed ~1234.5.6 [%noun !>(42)])
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-06 00:12:57 +03:00
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '!: .^(* %cx /~nul/desk/~1234.5.6/foo/bar)')
|
|
|
|
=/ subject-schematic=schematic:ford [%$ %noun !>(.)]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-42
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/dead] type=~ %make ~nul
|
|
|
|
[%ride formula subject-schematic]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-01 00:29:40 +03:00
|
|
|
^- tang
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
2018-05-01 00:57:32 +03:00
|
|
|
?> ?=([* %give %made @da %complete %success %ride *] i.moves)
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:: compare the move to the expected move, omitting vase type checking
|
|
|
|
::
|
|
|
|
:: Types can't be compared using simple equality, so normalize the
|
|
|
|
:: type to check the rest of the move.
|
|
|
|
::
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ i.moves(&8 *type)
|
2018-05-01 00:19:58 +03:00
|
|
|
:* duct=~[/dead] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%ride *type 42]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- &
|
|
|
|
(~(nest ut &8:i.moves) | -:!>(*@))
|
2018-04-06 00:12:57 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/dead] type=~ %kill ~nul]
|
|
|
|
moves=~
|
2018-04-06 00:12:57 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-06 00:12:57 +03:00
|
|
|
::
|
2018-04-06 00:31:59 +03:00
|
|
|
++ test-ride-scry-fail
|
|
|
|
~& %test-ride-scry-fail
|
|
|
|
::
|
|
|
|
=/ scry-failed (scry-fail ~1234.5.6)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-06 00:31:59 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=/ formula=hoon (ream '!: .^(* %cx /~nul/desk/~1234.5.6/foo/bar)')
|
|
|
|
=/ subject-schematic=schematic:ford [%$ %noun !>(.)]
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-failed
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/dead] type=~ %make ~nul
|
|
|
|
[%ride formula subject-schematic]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-01 00:29:40 +03:00
|
|
|
^- tang
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
|
|
|
?> ?=([* %give %made @da %complete %error *] i.moves)
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:: compare the move to the expected move, omitting check on stack trace
|
|
|
|
::
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ i.moves(|7 ~)
|
2018-05-01 00:19:58 +03:00
|
|
|
:* duct=~[/dead] %give %made ~1234.5.6 %complete
|
|
|
|
[%error [leaf+"ford: %ride failed:" ~]]
|
|
|
|
== ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/dead] type=~ %kill ~nul]
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-06 00:31:59 +03:00
|
|
|
::
|
2018-04-06 00:12:57 +03:00
|
|
|
++ test-ride-scry-block
|
|
|
|
~& %test-ride-scry-block
|
|
|
|
::
|
|
|
|
=/ scry-blocked (scry-block ~1234.5.6)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-06 00:12:57 +03:00
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '!: .^(* %cx /~nul/desk/~1234.5.6/foo/bar)')
|
|
|
|
=/ subject-schematic=schematic:ford [%$ %noun !>(.)]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-blocked
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/live] type=~ %make ~nul
|
|
|
|
[%ride formula subject-schematic]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass
|
2018-05-08 00:31:24 +03:00
|
|
|
wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
%c %warp [~nul ~nul] %desk
|
2018-05-01 23:56:24 +03:00
|
|
|
~ %sing %x [%da ~1234.5.6] /foo/bar
|
2018-05-01 00:19:58 +03:00
|
|
|
== == ==
|
2018-04-06 00:12:57 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-blocked
|
|
|
|
::
|
2018-05-08 23:27:21 +03:00
|
|
|
^= take-args
|
2018-05-08 00:31:24 +03:00
|
|
|
:* wire=/~nul/scry-request/cx/~nul/desk/~1234.5.6/foo/bar duct=~
|
2018-05-01 00:19:58 +03:00
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-01 00:29:40 +03:00
|
|
|
^- tang
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
?> =(1 (lent moves))
|
|
|
|
?> ?=(^ moves)
|
2018-05-01 00:57:32 +03:00
|
|
|
?> ?=([* %give %made @da %complete %success %ride *] i.moves)
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:: compare the move to the expected move, omitting vase type checking
|
|
|
|
::
|
|
|
|
:: Types can't be compared using simple equality, so normalize the
|
|
|
|
:: type to check the rest of the move.
|
|
|
|
::
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ i.moves(&8 *type)
|
2018-05-01 00:19:58 +03:00
|
|
|
:* duct=~[/live] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%ride *type 42]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:: make sure the types nest
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- &
|
|
|
|
(~(nest ut &8:i.moves) | -:!>(*@))
|
2018-04-06 00:12:57 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/live] type=~ %kill ~nul]
|
|
|
|
moves=~
|
2018-04-06 00:12:57 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-06 00:12:57 +03:00
|
|
|
::
|
2018-04-18 00:14:13 +03:00
|
|
|
++ test-ride-scry-promote
|
|
|
|
~& %test-ride-scry-promote
|
|
|
|
::
|
|
|
|
=/ 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)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '`@tas`%constant')
|
|
|
|
=/ subject-schematic=schematic:ford [%scry %c %x [~nul %desk] /bar/foo]
|
|
|
|
::
|
|
|
|
=/ ride=schematic:ford [%ride formula subject-schematic]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %make ~nul ride]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success [%ride scry-type %constant]]
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
2018-04-18 00:14:13 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
++ test-five-oh-fora
|
|
|
|
~& %test-five-oh-fora
|
|
|
|
::
|
2018-04-24 02:17:20 +03:00
|
|
|
=/ scry-type=type
|
|
|
|
[%cell [%face [~ %title] [%atom %tas ~]] [%face [~ %contents] -:!>("")]]
|
|
|
|
::
|
2018-04-18 00:14:13 +03:00
|
|
|
=/ scry-results=(map [term beam] cage)
|
|
|
|
%- my :~
|
|
|
|
:- [%cx [[~nul %desk %da ~1234.5.6] /a/posts]]
|
2018-04-24 02:17:20 +03:00
|
|
|
[%noun scry-type [title='post-a' contents="post-a-contents"]]
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
:- [%cx [[~nul %desk %da ~1234.5.6] /b/posts]]
|
2018-04-24 02:17:20 +03:00
|
|
|
[%noun scry-type [title='post-b' contents="post-b-contents"]]
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
:- [%cx [[~nul %desk %da ~1234.5.8] /a/posts]]
|
2018-04-24 02:17:20 +03:00
|
|
|
[%noun scry-type [title='post-a' contents="post-a-contents-changed"]]
|
2018-04-18 00:14:13 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
=/ scry (scry-with-results scry-results)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
=/ post-a=schematic:ford [%scry [%c %x [~nul %desk] /a/posts]]
|
|
|
|
=/ title-a=schematic:ford [%ride (ream '!: title') post-a]
|
|
|
|
::
|
|
|
|
=/ post-b=schematic:ford [%scry [%c %x [~nul %desk] /b/posts]]
|
|
|
|
=/ title-b=schematic:ford [%ride (ream '!: title') post-b]
|
|
|
|
::
|
|
|
|
=/ sidebar=schematic:ford [title-a title-b]
|
|
|
|
::
|
|
|
|
=/ rendered-a=schematic:ford [post-a sidebar]
|
|
|
|
=/ rendered-b=schematic:ford [post-b sidebar]
|
|
|
|
:: first, ask ford to build rendered-a
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-a] type=~ %make ~nul rendered-a]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-01 00:29:40 +03:00
|
|
|
^- tang
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
?> ?=([^ ^ ~] moves)
|
|
|
|
%+ welp
|
|
|
|
%- check-post-made :*
|
|
|
|
move=i.moves
|
|
|
|
duct=~[/post-a]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.6
|
|
|
|
title='post-a'
|
|
|
|
contents="post-a-contents"
|
|
|
|
==
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ i.t.moves
|
2018-05-01 00:19:58 +03:00
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)]
|
|
|
|
== ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-b] type=~ %make ~nul rendered-b]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-01 00:29:40 +03:00
|
|
|
^- tang
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
?> ?=([^ ~] moves)
|
|
|
|
%- check-post-made :*
|
|
|
|
move=i.moves
|
|
|
|
duct=~[/post-b]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.7
|
|
|
|
title='post-b'
|
|
|
|
contents="post-b-contents"
|
|
|
|
== ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.8] (sy [%x /posts/a]~)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-01 00:29:40 +03:00
|
|
|
^- tang
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
?> ?=([^ ^ ~] moves)
|
|
|
|
%- check-post-made :*
|
|
|
|
move=i.moves
|
|
|
|
duct=~[/post-a]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.8
|
|
|
|
title='post-a'
|
|
|
|
contents="post-a-contents-changed"
|
|
|
|
== ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-b] type=~ %kill ~nul]
|
|
|
|
moves=~
|
2018-04-18 00:14:13 +03:00
|
|
|
==
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results5 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.10
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-a] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
results5
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-04-24 02:17:20 +03:00
|
|
|
++ test-alts
|
|
|
|
~& %test-alts
|
|
|
|
::
|
|
|
|
=/ scry-type=type [%atom %tas ~]
|
|
|
|
::
|
|
|
|
=/ scry-results=(map [term beam] (unit cage))
|
|
|
|
%- my :~
|
|
|
|
:- [%cx [[~nul %first %da ~1234.5.6] /one/scry]]
|
|
|
|
~
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %second %da ~1234.5.6] /two/scry]]
|
|
|
|
~
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %first %da ~1234.5.7] /one/scry]]
|
|
|
|
~
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %second %da ~1234.5.7] /two/scry]]
|
|
|
|
`[%noun scry-type 'scry-two']
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %first %da ~1234.5.8] /one/scry]]
|
|
|
|
`[%noun scry-type 'scry-one']
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=/ scry (scry-with-results-and-failures scry-results)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
|
|
|
=/ scry1=schematic:ford [%scry [%c %x [~nul %first] /one/scry]]
|
|
|
|
=/ scry2=schematic:ford [%scry [%c %x [~nul %second] /two/scry]]
|
|
|
|
=/ alts=schematic:ford [%alts [scry1 scry2 ~]]
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/alts] type=~ %make ~nul alts]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/alts] %give %made ~1234.5.6 %complete
|
|
|
|
[%error [%leaf "%alts: all options failed"]~]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/first
|
|
|
|
%c %warp [~nul ~nul] %first
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /scry/one] ~)]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/second
|
|
|
|
%c %warp [~nul ~nul] %second
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /scry/two] ~)]
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/second duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /scry/two]~)]
|
2018-04-24 02:17:20 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/alts] %give %made ~1234.5.7 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-two'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/second
|
|
|
|
%c %warp [~nul ~nul] %second
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /scry/two] ~)]
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/first duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.8] (sy [%x /scry/one]~)]
|
2018-04-24 02:17:20 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/alts] %give %made ~1234.5.8 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-one'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/first
|
|
|
|
%c %warp [~nul ~nul] %first
|
|
|
|
`[%mult [%da ~1234.5.8] (sy [%x /scry/one] ~)]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/second
|
|
|
|
%c %warp [~nul ~nul] %second ~
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/alts] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/first
|
|
|
|
%c %warp [~nul ~nul] %first ~
|
|
|
|
== == ==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-24 02:17:20 +03:00
|
|
|
::
|
2018-04-25 21:16:27 +03:00
|
|
|
++ test-alts-and-live
|
|
|
|
~& %test-alts-and-live
|
2018-04-25 01:51:53 +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)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-25 01:51:53 +03:00
|
|
|
::
|
|
|
|
=/ scry2=schematic:ford [%scry [%c %x [~nul %desk] /two/scry]]
|
|
|
|
=/ same=schematic:ford [%same scry2]
|
|
|
|
:: depend on scry2 for the duration of the test
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/same] type=~ %make ~nul same]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/same] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %same %success %scry %noun scry-type 'scry-two'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /scry/two] ~)]
|
|
|
|
== == ==
|
2018-04-25 01:51:53 +03:00
|
|
|
::
|
|
|
|
=/ scry1=schematic:ford [%scry [%c %x [~nul %desk] /one/scry]]
|
|
|
|
=/ alts=schematic:ford [%alts [scry1 scry2 ~]]
|
|
|
|
:: call the alts schematic
|
|
|
|
::
|
|
|
|
:: The alts schematic should fail to read /scry/one, and should fallback
|
|
|
|
:: to /scry/two.
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/alts] type=~ %make ~nul alts]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/alts] %give %made ~1234.5.7 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-two'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /scry/two] [%x /scry/one] ~)]
|
|
|
|
== == ==
|
2018-04-25 01:51:53 +03:00
|
|
|
::
|
|
|
|
:: tell ford that /scry/one exists now
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.8] (sy [%x /scry/one]~)]
|
2018-04-25 01:51:53 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/alts] %give %made ~1234.5.8 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-one'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:: we subscribe to both paths because /same still exists.
|
|
|
|
::
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.8] (sy [%x /scry/one] [%x /scry/two] ~)]
|
|
|
|
== == ==
|
2018-04-25 01:51:53 +03:00
|
|
|
::
|
|
|
|
:: kill the /same build
|
|
|
|
::
|
|
|
|
:: We should no longer subscribe to /scry/two in the resulting clay
|
|
|
|
:: subscription.
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/same] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.8] (sy [%x /scry/one] ~)]
|
|
|
|
== == ==
|
2018-04-25 01:51:53 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results5 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.10
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/alts] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-25 21:16:27 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
results5
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-25 21:16:27 +03:00
|
|
|
::
|
|
|
|
++ test-double-alts
|
|
|
|
~& %test-double-alts
|
|
|
|
::
|
|
|
|
=/ 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] /three/scry]]
|
|
|
|
~
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %desk %da ~1234.5.7] /two/scry]]
|
|
|
|
`[%noun scry-type 'scry-two']
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %desk %da ~1234.5.8] /three/scry]]
|
|
|
|
`[%noun scry-type 'scry-three']
|
|
|
|
::
|
|
|
|
:- [%cx [[~nul %desk %da ~1234.5.8] /two/scry]]
|
|
|
|
`[%noun scry-type 'scry-two']
|
|
|
|
::
|
|
|
|
:- [%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']
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=/ scry (scry-with-results-and-failures scry-results)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-04-25 21:16:27 +03:00
|
|
|
::
|
|
|
|
=/ scry1=schematic:ford [%scry [%c %x [~nul %desk] /one/scry]]
|
|
|
|
=/ scry2=schematic:ford [%scry [%c %x [~nul %desk] /two/scry]]
|
|
|
|
=/ scry3=schematic:ford [%scry [%c %x [~nul %desk] /three/scry]]
|
|
|
|
=/ alts1=schematic:ford [%alts [scry1 scry2 ~]]
|
|
|
|
=/ alts2=schematic:ford [%alts [scry3 scry2 ~]]
|
|
|
|
:: alts1 will depend on both scry1 and scry2
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/first] type=~ %make ~nul alts1]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/first] %give %made ~1234.5.6 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-two'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /scry/one] [%x /scry/two] ~)]
|
|
|
|
== == ==
|
2018-04-25 21:16:27 +03:00
|
|
|
:: alts2 will depend on both scry3 and scry2
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/second] type=~ %make ~nul alts2]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/second] %give %made ~1234.5.7 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-two'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~ %mult [%da ~1234.5.7]
|
|
|
|
(sy [%x /scry/one] [%x /scry/two] [%x /scry/three] ~)
|
|
|
|
== == ==
|
2018-04-25 21:16:27 +03:00
|
|
|
::
|
|
|
|
:: alts2 should now just return 'scry-three'
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.8] (sy [%x /scry/three]~)]
|
2018-04-25 21:16:27 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/second] %give %made ~1234.5.8 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-three'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~ %mult [%da ~1234.5.8]
|
|
|
|
(sy [%x /scry/one] [%x /scry/two] [%x /scry/three] ~)
|
|
|
|
== == ==
|
2018-04-25 21:16:27 +03:00
|
|
|
::
|
|
|
|
:: alts1 should now just return 'scry-one'
|
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.9] (sy [%x /scry/one] [%x /scry/two] ~)]
|
2018-04-25 21:16:27 +03:00
|
|
|
==
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/first] %give %made ~1234.5.9 %complete
|
2018-05-01 00:57:32 +03:00
|
|
|
%success %alts %success %scry %noun scry-type 'scry-one'
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~ %mult [%da ~1234.5.9]
|
|
|
|
(sy [%x /scry/one] [%x /scry/three] ~)
|
|
|
|
== == ==
|
2018-04-25 21:16:27 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results5 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.10
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/first] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~ %mult [%da ~1234.5.9]
|
|
|
|
(sy [%x /scry/three] ~)
|
|
|
|
== == ==
|
2018-04-25 21:16:27 +03:00
|
|
|
::
|
2018-05-01 00:19:58 +03:00
|
|
|
=^ results6 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.11
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/second] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
2018-04-25 01:51:53 +03:00
|
|
|
::
|
2018-05-01 20:55:05 +03:00
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
results5
|
|
|
|
results6
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
:: +test-cache-reclamation-trivial: reclaim cache on a blank slate ford
|
|
|
|
::
|
|
|
|
++ test-cache-reclamation-trivial
|
|
|
|
~& %test-cache-reclamation-trivial
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 20:55:05 +03:00
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: send a pinned literal, expects a %made response with pinned literal
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
[duct=~ type=~ %make ~nul [%pin ~1234.5.6 [%$ %noun !>(**)]]]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6
|
|
|
|
%complete %success %pin ~1234.5.6 %success %$ %noun !>(**)
|
|
|
|
== ==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: ask ford to wipe its cache
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %wipe ~]
|
|
|
|
:: cache wiping should never produce any moves
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: welp
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ test-cache-reclamation-live-rebuild
|
|
|
|
~& %test-cache-reclamation-live-rebuild
|
|
|
|
::
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 20:55:05 +03:00
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-succeed ~1234.5.6 [%noun !>(42)])
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~ type=~ %make ~nul
|
|
|
|
[%scry %c care=%x rail=[[~nul %desk] /bar/foo]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %success
|
|
|
|
[%scry %noun !>(42)]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: ask ford to wipe its cache
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %wipe ~]
|
|
|
|
:: cache wiping should never produce any moves
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=(scry-succeed ~1234.5.7 [%noun !>(43)])
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.7 %complete %success
|
|
|
|
[%scry %noun !>(43)]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ test-cache-reclamation-live-promote
|
|
|
|
~& %test-cache-reclamation-live-promote
|
|
|
|
::
|
|
|
|
=/ 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)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-01 20:55:05 +03:00
|
|
|
::
|
|
|
|
=/ formula=hoon (ream '`@tas`%constant')
|
|
|
|
=/ subject-schematic=schematic:ford [%scry %c %x [~nul %desk] /bar/foo]
|
|
|
|
::
|
|
|
|
=/ ride=schematic:ford [%ride formula subject-schematic]
|
|
|
|
=/ same=schematic:ford [%same ride]
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %make ~nul same]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/ride] %give %made ~1234.5.6 %complete
|
|
|
|
[%success [%same [%success [%ride scry-type %constant]]]]
|
|
|
|
==
|
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
:: ask ford to wipe its cache
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %wipe ~]
|
|
|
|
:: cache wiping should never produce any moves
|
|
|
|
::
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-take :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.7] (sy [%x /foo/bar]~)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.7] (sy [%x /foo/bar] ~)]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/ride] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-05-02 01:33:30 +03:00
|
|
|
:: tests that doing a cache reclamation during the five-oh-fora rebuild works
|
|
|
|
::
|
|
|
|
++ test-five-oh-cache-reclamation
|
|
|
|
~& %test-five-oh-cache-reclamation
|
|
|
|
::
|
|
|
|
=/ scry-type=type
|
|
|
|
[%cell [%face [~ %title] [%atom %tas ~]] [%face [~ %contents] -:!>("")]]
|
|
|
|
::
|
|
|
|
=/ 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"]]
|
2018-05-08 01:04:54 +03:00
|
|
|
::
|
|
|
|
:: 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"]]
|
2018-05-02 01:33:30 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
=/ scry (scry-with-results scry-results)
|
2018-05-08 01:59:39 +03:00
|
|
|
=/ ford *ford-gate
|
2018-05-02 01:33:30 +03:00
|
|
|
::
|
|
|
|
=/ post-a=schematic:ford [%scry [%c %x [~nul %desk] /a/posts]]
|
|
|
|
=/ title-a=schematic:ford [%ride (ream '!: title') post-a]
|
|
|
|
::
|
|
|
|
=/ post-b=schematic:ford [%scry [%c %x [~nul %desk] /b/posts]]
|
|
|
|
=/ title-b=schematic:ford [%ride (ream '!: title') post-b]
|
|
|
|
::
|
|
|
|
=/ sidebar=schematic:ford [title-a title-b]
|
|
|
|
::
|
|
|
|
=/ rendered-a=schematic:ford [post-a sidebar]
|
|
|
|
=/ rendered-b=schematic:ford [post-b sidebar]
|
|
|
|
:: first, ask ford to build rendered-a
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-a] type=~ %make ~nul rendered-a]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-02 01:33:30 +03:00
|
|
|
^- tang
|
|
|
|
::
|
|
|
|
?> ?=([^ ^ ~] moves)
|
|
|
|
%+ welp
|
|
|
|
%- check-post-made :*
|
|
|
|
move=i.moves
|
|
|
|
duct=~[/post-a]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.6
|
|
|
|
title='post-a'
|
|
|
|
contents="post-a-contents"
|
|
|
|
==
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ i.t.moves
|
2018-05-02 01:33:30 +03:00
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
=^ results2 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.7
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-b] type=~ %make ~nul rendered-b]
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-02 01:33:30 +03:00
|
|
|
^- tang
|
|
|
|
::
|
|
|
|
?> ?=([^ ~] moves)
|
|
|
|
%- check-post-made :*
|
|
|
|
move=i.moves
|
|
|
|
duct=~[/post-b]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.7
|
|
|
|
title='post-b'
|
|
|
|
contents="post-b-contents"
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
=^ results3 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.8
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~ type=~ %wipe ~]
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results4 ford
|
|
|
|
%- test-ford-take-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.9
|
|
|
|
scry=scry
|
|
|
|
::
|
|
|
|
^= take-args
|
|
|
|
:* wire=/~nul/clay-sub/~nul/desk duct=~
|
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type
|
|
|
|
[%c %wris [%da ~1234.5.9] (sy [%x /posts/a]~)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= moves=(list move:ford-gate)
|
2018-05-02 01:33:30 +03:00
|
|
|
^- tang
|
|
|
|
::
|
2018-05-08 01:28:52 +03:00
|
|
|
=+ 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)
|
|
|
|
::
|
|
|
|
%- check-post-made :*
|
|
|
|
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
|
|
|
|
%- check-post-made :*
|
|
|
|
move=i.moves
|
|
|
|
duct=~[/post-a]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.9
|
|
|
|
title='post-a'
|
|
|
|
contents="post-a-contents-changed"
|
|
|
|
==
|
|
|
|
%- check-post-made :*
|
|
|
|
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
|
|
|
|
%- check-post-made :*
|
|
|
|
move=i.moves
|
|
|
|
duct=~[/post-b]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.9
|
|
|
|
title='post-b'
|
|
|
|
contents="post-b"
|
|
|
|
==
|
2018-05-08 00:15:24 +03:00
|
|
|
::
|
2018-05-02 01:33:30 +03:00
|
|
|
%- check-post-made :*
|
2018-05-08 01:28:52 +03:00
|
|
|
move=i.t.moves
|
2018-05-02 01:33:30 +03:00
|
|
|
duct=~[/post-a]
|
|
|
|
type=scry-type
|
|
|
|
date=~1234.5.9
|
|
|
|
title='post-a'
|
|
|
|
contents="post-a-contents-changed"
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
=^ results5 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.10
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-b] type=~ %kill ~nul]
|
|
|
|
moves=~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
=^ results6 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.11
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
call-args=[duct=~[/post-a] type=~ %kill ~nul]
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
|
|
|
%c %warp [~nul ~nul] %desk ~
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
results2
|
|
|
|
results3
|
|
|
|
results4
|
|
|
|
results5
|
|
|
|
results6
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
2018-04-25 01:51:53 +03:00
|
|
|
::
|
2018-05-08 02:12:07 +03:00
|
|
|
++ test-reef
|
|
|
|
~& %test-reef
|
|
|
|
::
|
|
|
|
=/ ford *ford-gate
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/reef] type=~ %make ~nul
|
|
|
|
[%pin ~1234.5.6 [%reef ~]]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/reef] %give %made ~1234.5.6 %complete
|
|
|
|
%success %pin ~1234.5.6 %success %reef test-pit
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
2018-05-10 23:34:25 +03:00
|
|
|
++ test-path
|
|
|
|
~& %test-path
|
|
|
|
::
|
|
|
|
=/ ford *ford-gate
|
|
|
|
::
|
|
|
|
=/ 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
|
|
|
|
%- test-ford-call :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=(scry-with-results-and-failures scry-results)
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/path] type=~ %make ~nul
|
|
|
|
%pin ~1234.5.6
|
|
|
|
[%path disc=[~nul %desk] prefix='lib' raw-path='foo-bar']
|
|
|
|
==
|
|
|
|
::
|
|
|
|
^= moves
|
|
|
|
:~ :* duct=~[/path] %give %made ~1234.5.6 %complete
|
|
|
|
%success %pin ~1234.5.6
|
|
|
|
%success %path [[~nul %desk] /hoon/bar/foo/lib]
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
2018-05-09 02:54:29 +03:00
|
|
|
++ test-plan-direct-hoon
|
|
|
|
~& %test-plan-direct-hoon
|
|
|
|
::
|
|
|
|
=/ ford *ford-gate
|
|
|
|
::
|
|
|
|
=/ =hoon (ream '`@tas`%constant')
|
|
|
|
::
|
|
|
|
=^ results1 ford
|
|
|
|
%- test-ford-call-with-comparator :*
|
|
|
|
ford
|
|
|
|
now=~1234.5.6
|
|
|
|
scry=scry-is-forbidden
|
|
|
|
::
|
|
|
|
^= call-args
|
|
|
|
:* duct=~[/plan] type=~ %make ~nul
|
|
|
|
%pin ~1234.5.6
|
|
|
|
%plan
|
|
|
|
source-path=[[~nul %desk] /bar/foo]
|
|
|
|
query-string=`coin`[%$ *dime]
|
|
|
|
zuse-version=309
|
|
|
|
structures=~
|
|
|
|
libraries=~
|
|
|
|
cranes=~
|
|
|
|
sources=[%direct 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 %pin @da %success %plan *] +.result)
|
|
|
|
::
|
|
|
|
=/ =vase |5:+.result
|
|
|
|
::
|
|
|
|
%+ weld
|
|
|
|
%- expect-eq !>
|
|
|
|
:- &
|
|
|
|
(~(nest ut p.vase) | -:!>(*@tas))
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
[%constant q.vase]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
;: weld
|
|
|
|
results1
|
|
|
|
(expect-ford-empty ford ~nul)
|
|
|
|
==
|
|
|
|
::
|
2018-03-23 21:53:38 +03:00
|
|
|
:: |utilities: helper arms
|
|
|
|
::
|
|
|
|
::+| utilities
|
2018-04-18 00:14:13 +03:00
|
|
|
++ check-post-made
|
2018-05-08 01:59:39 +03:00
|
|
|
|= $: move=move:ford-gate
|
2018-04-18 00:14:13 +03:00
|
|
|
=duct
|
2018-04-24 02:17:20 +03:00
|
|
|
=type
|
2018-04-18 00:14:13 +03:00
|
|
|
date=@da
|
|
|
|
title=@tas
|
|
|
|
contents=tape
|
|
|
|
==
|
2018-04-30 23:11:18 +03:00
|
|
|
^- tang
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
2018-05-01 00:57:32 +03:00
|
|
|
?> ?=([* %give %made @da %complete %success ^ *] move)
|
2018-04-18 00:14:13 +03:00
|
|
|
=/ result result.p.card.move
|
2018-05-01 00:57:32 +03:00
|
|
|
?> ?=([%success %scry %noun type-a=* @tas *] head.result)
|
|
|
|
?> ?=([%success ^ *] tail.result)
|
|
|
|
?> ?=([%success %ride type-title-a=* %post-a] head.tail.result)
|
|
|
|
?> ?=([%success %ride type-title-b=* %post-b] tail.tail.result)
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
;: welp
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
[duct duct.move]
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
[date date.p.card.move]
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:_ head.result(p.q.cage *^type)
|
2018-05-01 00:57:32 +03:00
|
|
|
[%success %scry %noun *^type [title=title contents=contents]]
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- &
|
|
|
|
(~(nest ut p.q.cage.head.result) | type)
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- [%success %ride *^type 'post-a']
|
|
|
|
head.tail.result(p.vase *^type)
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- &
|
|
|
|
(~(nest ut p.vase.head.tail.result) | -:!>(''))
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- [%success %ride *^type 'post-b']
|
|
|
|
tail.tail.result(p.vase *^type)
|
2018-04-18 00:14:13 +03:00
|
|
|
::
|
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- &
|
|
|
|
(~(nest ut p.vase.tail.tail.result) | -:!>(''))
|
2018-04-18 00:14:13 +03:00
|
|
|
==
|
2018-03-23 21:53:38 +03:00
|
|
|
::
|
2018-04-18 00:14:13 +03:00
|
|
|
:: +scry-with-results
|
|
|
|
++ scry-with-results
|
|
|
|
|= results=(map [=term =beam] cage)
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| scry-with-results+[term=term beam=beam]
|
|
|
|
::
|
|
|
|
[~ ~ (~(got by results) [term beam])]
|
2018-04-24 02:17:20 +03:00
|
|
|
:: +scry-with-results-and-failures
|
|
|
|
::
|
|
|
|
++ scry-with-results-and-failures
|
|
|
|
|= results=(map [=term =beam] (unit cage))
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| scry-with-results+[term=term beam=beam]
|
|
|
|
::
|
|
|
|
[~ (~(got by results) [term beam])]
|
2018-03-23 21:53:38 +03:00
|
|
|
:: +scry-succeed: produces a scry function with a known request and answer
|
|
|
|
::
|
|
|
|
++ scry-succeed
|
|
|
|
|= [date=@da result=cage] ^- sley
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| scry-succeed+[beam+beam term+term]
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da date] /bar/foo])
|
|
|
|
::
|
|
|
|
[~ ~ result]
|
|
|
|
:: +scry-fail: produces a scry function with a known request and failed answer
|
|
|
|
::
|
|
|
|
++ scry-fail
|
|
|
|
|= date=@da ^- sley
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| scry-fail+[beam+beam term+term]
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da date] /bar/foo])
|
|
|
|
::
|
|
|
|
[~ ~]
|
|
|
|
:: +scry-block: produces a scry function with known request and blocked answer
|
|
|
|
::
|
|
|
|
++ scry-block
|
|
|
|
|= date=@da ^- sley
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| scry-block+[beam+beam term+term]
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da date] /bar/foo])
|
|
|
|
::
|
|
|
|
~
|
2018-05-08 23:27:21 +03:00
|
|
|
::
|
|
|
|
++ scry-blocks
|
|
|
|
|= dates=(set @da) ^- sley
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| scry-block+[beam+beam term+term]
|
|
|
|
?> =(term %cx)
|
|
|
|
?> ?=([%da @da] r.beam)
|
|
|
|
?> (~(has in dates) p.r.beam)
|
|
|
|
::
|
|
|
|
~
|
2018-03-23 21:53:38 +03:00
|
|
|
:: +scry-is-forbidden: makes sure ford does not attempt to scry
|
|
|
|
::
|
|
|
|
++ scry-is-forbidden ^- sley
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| scry-is-forbidden+[beam+beam term+term]
|
|
|
|
!!
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
++ test-ford-call
|
2018-05-08 01:59:39 +03:00
|
|
|
|= $: ford=_(ford-gate)
|
2018-05-01 00:19:58 +03:00
|
|
|
now=@da
|
|
|
|
scry=sley
|
2018-05-08 01:59:39 +03:00
|
|
|
call-args=[=duct type=* wrapped-task=(hobo task:able:ford-gate)]
|
|
|
|
expected-moves=(list move:ford-gate)
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
2018-05-08 01:59:39 +03:00
|
|
|
^- [tang _(ford-gate)]
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
=. ford (ford now=now eny=0xdead.beef scry=scry)
|
|
|
|
::
|
|
|
|
=^ moves ford
|
|
|
|
%- call:ford call-args
|
|
|
|
::
|
2018-05-01 00:29:40 +03:00
|
|
|
=/ output=tang
|
2018-05-01 00:19:58 +03:00
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- expected-moves
|
|
|
|
moves
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
[output ford]
|
|
|
|
::
|
|
|
|
++ test-ford-take
|
2018-05-08 01:59:39 +03:00
|
|
|
|= $: ford=_(ford-gate)
|
2018-05-01 00:19:58 +03:00
|
|
|
now=@da
|
|
|
|
scry=sley
|
2018-05-08 01:59:39 +03:00
|
|
|
take-args=[=wire =duct wrapped-sign=(hypo sign:ford-gate)]
|
|
|
|
expected-moves=(list move:ford-gate)
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
2018-05-08 01:59:39 +03:00
|
|
|
^- [tang _(ford-gate)]
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
=. ford (ford now=now eny=0xdead.beef scry=scry)
|
|
|
|
::
|
|
|
|
=^ moves ford
|
|
|
|
%- take:ford take-args
|
|
|
|
::
|
2018-05-01 00:29:40 +03:00
|
|
|
=/ output=tang
|
2018-05-01 00:19:58 +03:00
|
|
|
%- expect-eq !>
|
2018-05-08 00:15:24 +03:00
|
|
|
:- expected-moves
|
|
|
|
moves
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
[output ford]
|
|
|
|
:: +test-ford-call-with-comparator
|
|
|
|
::
|
|
|
|
:: Sometimes we can't just do simple comparisons between the moves statements and
|
|
|
|
:: must instead specify a gate that performs the comparisons.
|
|
|
|
::
|
|
|
|
++ test-ford-call-with-comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= $: ford=_(ford-gate)
|
2018-05-01 00:19:58 +03:00
|
|
|
now=@da
|
|
|
|
scry=sley
|
2018-05-08 01:59:39 +03:00
|
|
|
call-args=[=duct type=* wrapped-task=(hobo task:able:ford-gate)]
|
|
|
|
move-comparator=$-((list move:ford-gate) tang)
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
2018-05-08 01:59:39 +03:00
|
|
|
^- [tang _(ford-gate)]
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
=. ford (ford now=now eny=0xdead.beef scry=scry)
|
|
|
|
::
|
|
|
|
=^ moves ford
|
|
|
|
%- call:ford call-args
|
|
|
|
::
|
2018-05-01 00:29:40 +03:00
|
|
|
=/ output=tang (move-comparator moves)
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
[output ford]
|
|
|
|
:: +test-ford-take-with-comparator
|
|
|
|
::
|
|
|
|
++ test-ford-take-with-comparator
|
2018-05-08 01:59:39 +03:00
|
|
|
|= $: ford=_(ford-gate)
|
2018-05-01 00:19:58 +03:00
|
|
|
now=@da
|
|
|
|
scry=sley
|
2018-05-08 01:59:39 +03:00
|
|
|
take-args=[=wire =duct wrapped-sign=(hypo sign:ford-gate)]
|
|
|
|
move-comparator=$-((list move:ford-gate) tang)
|
2018-05-01 00:19:58 +03:00
|
|
|
==
|
2018-05-08 01:59:39 +03:00
|
|
|
^- [tang _(ford-gate)]
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
=. ford (ford now=now eny=0xdead.beef scry=scry)
|
|
|
|
::
|
|
|
|
=^ moves ford
|
|
|
|
%- take:ford take-args
|
|
|
|
::
|
2018-05-01 00:29:40 +03:00
|
|
|
=/ output=tang (move-comparator moves)
|
2018-05-01 00:19:58 +03:00
|
|
|
::
|
|
|
|
[output ford]
|
2018-04-28 02:30:09 +03:00
|
|
|
:: +expect-ford-empty: assert that ford's state is one empty ship
|
|
|
|
::
|
|
|
|
:: At the end of every test, we want to assert that we have cleaned up all
|
|
|
|
:: state.
|
|
|
|
::
|
|
|
|
++ expect-ford-empty
|
2018-05-08 01:59:39 +03:00
|
|
|
|= [ford=_(ford-gate) ship=@p]
|
2018-04-30 23:11:18 +03:00
|
|
|
^- tang
|
2018-04-28 02:30:09 +03:00
|
|
|
%- expect-eq !>
|
2018-05-08 01:59:39 +03:00
|
|
|
:- (my [ship *ford-state:ford-gate]~)
|
2018-05-08 00:15:24 +03:00
|
|
|
state-by-ship.+>+<.ford
|
2018-04-28 02:30:09 +03:00
|
|
|
--
|