2018-03-16 03:21:46 +03:00
|
|
|
/+ ford-turbo, tester
|
|
|
|
::
|
|
|
|
:- %say
|
|
|
|
|= [[now=@da eny=@ =beak] ~ ~]
|
|
|
|
:- %noun
|
|
|
|
=+ tester:tester
|
2018-03-20 04:03:18 +03:00
|
|
|
=/ ford (ford-turbo now=~1234.5.6 eny=0xdead.beef scry=*sley)
|
2018-03-16 03:21:46 +03:00
|
|
|
|^
|
|
|
|
^- wall
|
|
|
|
;: weld
|
|
|
|
test-compiles
|
2018-03-20 20:30:39 +03:00
|
|
|
test-unify-jugs
|
2018-03-21 01:39:22 +03:00
|
|
|
test-dependency-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-03-16 03:21:46 +03:00
|
|
|
==
|
|
|
|
++ test-compiles
|
|
|
|
~& %test-compiles
|
|
|
|
%- expect-eq !>
|
|
|
|
[ford-turbo ford-turbo]
|
|
|
|
::
|
2018-03-20 20:30:39 +03:00
|
|
|
++ test-unify-jugs
|
|
|
|
~& %test-unify-jugs
|
|
|
|
%- expect-eq !>
|
|
|
|
:- %+ 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 ~)]])
|
|
|
|
::
|
|
|
|
`(jug @tas @ud)`(my ~[[%a (sy 1 2 ~)] [%b (sy 3 4 5 6 ~)] [%c (sy 7 8 ~)]])
|
|
|
|
::
|
2018-03-21 01:39:22 +03:00
|
|
|
++ test-dependency-wire-encoding
|
|
|
|
~& %test-dependency-wire-encoding
|
|
|
|
;: welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- `path`(to-wire:ford [%clay-live care=%x bel=[[~nul %desk] /foo/bar]])
|
|
|
|
/c/x/.y/~nul/desk/0/bar/foo
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- `dependency:ford`[%clay-live care=%x bel=[[~nul %desk] /foo/bar]]
|
|
|
|
(from-wire:ford /c/x/.y/~nul/desk/0/bar/foo)
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ^- path
|
|
|
|
(to-wire:ford [%clay-once care=%x beam=[[~nul %desk %ud 42] /foo/bar]])
|
|
|
|
/c/x/.n/~nul/desk/42/bar/foo
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ^- dependency:ford
|
|
|
|
[%clay-once care=%x beam=[[~nul %desk %ud 42] /foo/bar]]
|
|
|
|
(from-wire:ford /c/x/.n/~nul/desk/42/bar/foo)
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ^- path
|
|
|
|
(to-wire:ford [%gall-live care=%x bel=[[~nul %desk] /foo/bar]])
|
|
|
|
/g/x/.y/~nul/desk/0/bar/foo
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ^- dependency:ford
|
|
|
|
[%gall-live care=%x bel=[[~nul %desk] /foo/bar]]
|
|
|
|
(from-wire:ford /g/x/.y/~nul/desk/0/bar/foo)
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ^- path
|
|
|
|
%- to-wire:ford
|
|
|
|
[%gall-once care=%x beam=[[~nul %desk %da ~1234.5.6] /foo/bar]]
|
|
|
|
/g/x/.n/~nul/desk/~1234.5.6/bar/foo
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- ^- dependency:ford
|
|
|
|
[%gall-once care=%x beam=[[~nul %desk %da ~1234.5.6] /foo/bar]]
|
|
|
|
(from-wire:ford /g/x/.n/~nul/desk/~1234.5.6/bar/foo)
|
|
|
|
::
|
|
|
|
==
|
|
|
|
::
|
2018-03-20 04:03:18 +03:00
|
|
|
++ test-literal
|
|
|
|
~& %test-literal
|
2018-03-19 21:23:04 +03:00
|
|
|
=^ moves ford
|
|
|
|
%- call:ford
|
|
|
|
:* duct=~
|
|
|
|
type=~
|
|
|
|
%make
|
|
|
|
~nul
|
|
|
|
plan=[%$ %noun !>(**)]
|
|
|
|
date=`~1234.5.6
|
|
|
|
==
|
2018-03-20 04:03:18 +03:00
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves
|
|
|
|
[duct=~ %give %made ~1234.5.6 %complete %result %$ %noun !>(**)]~
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- state-by-ship.+>+<.ford
|
|
|
|
(my [~nul *ford-state:ford-turbo]~)
|
|
|
|
::
|
|
|
|
++ test-autocons-same
|
|
|
|
~& %test-autocons-same
|
|
|
|
=^ moves ford
|
|
|
|
%- call:ford
|
|
|
|
:* duct=~
|
|
|
|
type=~
|
|
|
|
%make
|
|
|
|
~nul
|
|
|
|
plan=[[%$ %noun !>(**)] [%$ %noun !>(**)]]
|
|
|
|
date=`~1234.5.6
|
|
|
|
==
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete
|
|
|
|
%result
|
|
|
|
[%result %$ %noun !>(**)]
|
|
|
|
[%result %$ %noun !>(**)]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- state-by-ship.+>+<.ford
|
|
|
|
(my [~nul *ford-state:ford-turbo]~)
|
|
|
|
::
|
|
|
|
++ test-autocons-different
|
|
|
|
~& %test-autocons-different
|
|
|
|
=^ moves ford
|
|
|
|
%- call:ford
|
|
|
|
:* duct=~
|
|
|
|
type=~
|
|
|
|
%make
|
|
|
|
~nul
|
|
|
|
plan=[[%$ %noun !>(42)] [%$ %noun !>(43)]]
|
|
|
|
date=`~1234.5.6
|
|
|
|
==
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete
|
|
|
|
%result
|
|
|
|
[%result %$ %noun !>(42)]
|
|
|
|
[%result %$ %noun !>(43)]
|
|
|
|
== ==
|
2018-03-19 21:23:04 +03:00
|
|
|
::
|
2018-03-16 03:21:46 +03:00
|
|
|
%- expect-eq !>
|
2018-03-19 21:23:04 +03:00
|
|
|
:- state-by-ship.+>+<.ford
|
2018-03-19 21:33:34 +03:00
|
|
|
(my [~nul *ford-state:ford-turbo]~)
|
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-20 22:01:49 +03:00
|
|
|
=/ scry
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da ~1234.5.6] /foo/bar])
|
|
|
|
::
|
|
|
|
[~ ~ %noun !>(42)]
|
|
|
|
::
|
|
|
|
=. ford (ford-turbo now=~1234.5.6 eny=0xdead.beef scry=scry)
|
|
|
|
=^ moves ford
|
|
|
|
%- call:ford
|
|
|
|
:* duct=~
|
|
|
|
type=~
|
|
|
|
%make
|
|
|
|
~nul
|
|
|
|
plan=[%scry %clay-once ren=%x bem=[[~nul %desk %da ~1234.5.6] /foo/bar]]
|
|
|
|
date=`~1234.5.6
|
|
|
|
==
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %result
|
|
|
|
[%scry %noun !>(42)]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- state-by-ship.+>+<.ford
|
|
|
|
(my [~nul *ford-state:ford-turbo]~)
|
2018-03-20 22:30:48 +03:00
|
|
|
::
|
|
|
|
++ test-scry-clay-fail
|
|
|
|
~& %test-scry-clay-fail
|
|
|
|
=/ scry
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da ~1234.5.6] /bar/foo])
|
|
|
|
::
|
|
|
|
[~ ~]
|
|
|
|
::
|
|
|
|
=. ford (ford-turbo now=~1234.5.6 eny=0xdead.beef scry=scry)
|
|
|
|
=^ moves ford
|
|
|
|
%- call:ford
|
|
|
|
:* duct=~
|
|
|
|
type=~
|
|
|
|
%make
|
|
|
|
~nul
|
|
|
|
plan=[%scry %clay-once ren=%x bem=[[~nul %desk %da ~1234.5.6] /bar/foo]]
|
|
|
|
date=`~1234.5.6
|
|
|
|
==
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %error
|
2018-03-21 04:20:11 +03:00
|
|
|
:~ leaf+"clay-once scry failed for"
|
2018-03-20 22:30:48 +03:00
|
|
|
leaf+"%cx /~nul/desk/~1234.5.6/foo/bar"
|
|
|
|
== == ==
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- state-by-ship.+>+<.ford
|
|
|
|
(my [~nul *ford-state:ford-turbo]~)
|
2018-03-21 01:39:22 +03:00
|
|
|
::
|
2018-03-21 03:37:57 +03:00
|
|
|
++ test-scry-clay-block
|
|
|
|
~& %test-scry-clay-block
|
|
|
|
=/ scry-block
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da ~1234.5.6] /bar/foo])
|
|
|
|
::
|
|
|
|
~
|
2018-03-21 04:20:11 +03:00
|
|
|
:: scry-is-forbidden: makes sure ford does not attempt to scry
|
2018-03-21 03:37:57 +03:00
|
|
|
::
|
2018-03-21 04:20:11 +03:00
|
|
|
=/ scry-is-forbidden
|
2018-03-21 03:37:57 +03:00
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
~| term+term
|
|
|
|
~| beam+beam
|
2018-03-21 04:20:11 +03:00
|
|
|
!!
|
2018-03-21 03:37:57 +03:00
|
|
|
::
|
|
|
|
=. ford (ford-turbo now=~1234.5.6 eny=0xdead.beef scry=scry-block)
|
|
|
|
=^ moves ford
|
|
|
|
%- call:ford
|
|
|
|
:* duct=~
|
|
|
|
type=~
|
|
|
|
%make
|
|
|
|
~nul
|
|
|
|
plan=[%scry %clay-once ren=%x bem=[[~nul %desk %da ~1234.5.6] /bar/foo]]
|
|
|
|
date=`~1234.5.6
|
|
|
|
==
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves
|
2018-03-22 23:30:44 +03:00
|
|
|
:~ :* duct=~ %pass
|
|
|
|
wire=/~nul/dependency/c/x/.n/~nul/desk/~1234.5.6/foo/bar
|
2018-03-21 03:37:57 +03:00
|
|
|
%c %warp [~nul ~nul] %desk
|
|
|
|
~ %sing %x [%da ~1234.5.6] /bar/foo
|
|
|
|
== ==
|
|
|
|
::
|
2018-03-21 04:20:11 +03:00
|
|
|
=. ford (ford now=~1234.5.7 eny=0xbeef.dead scry=scry-is-forbidden)
|
2018-03-21 03:37:57 +03:00
|
|
|
::
|
|
|
|
=^ moves2 ford
|
|
|
|
%- take:ford
|
2018-03-22 23:30:44 +03:00
|
|
|
:* wire=/~nul/dependency/c/x/.n/~nul/desk/~1234.5.6/foo/bar duct=~
|
2018-03-21 03:37:57 +03:00
|
|
|
^= wrapped-sign ^- (hypo sign:ford) :- *type :: ^- sign:ford
|
|
|
|
[%c %writ ~ [%x [%da ~1234.5.6] %desk] /bar/foo %noun !>(42)]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves2
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %result
|
|
|
|
[%scry %noun !>(42)]
|
|
|
|
== ==
|
|
|
|
::
|
|
|
|
%- expect-eq !>
|
|
|
|
:- state-by-ship.+>+<.ford
|
|
|
|
(my [~nul *ford-state:ford-turbo]~)
|
2018-03-22 04:27:25 +03:00
|
|
|
::
|
|
|
|
++ test-scry-clay-live
|
|
|
|
~& %test-scry-clay-live
|
2018-03-23 05:17:00 +03:00
|
|
|
=/ scry-42
|
2018-03-22 04:27:25 +03:00
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da ~1234.5.6] /foo/bar])
|
2018-03-23 05:17:00 +03:00
|
|
|
~& %scry-42
|
2018-03-22 04:27:25 +03:00
|
|
|
::
|
|
|
|
[~ ~ %noun !>(42)]
|
|
|
|
::
|
2018-03-23 05:17:00 +03:00
|
|
|
=/ scry-43
|
|
|
|
|= [* (unit (set monk)) =term =beam]
|
|
|
|
^- (unit (unit cage))
|
|
|
|
::
|
|
|
|
?> =(term %cx)
|
|
|
|
?> =(beam [[~nul %desk %da ~1234.5.7] /foo/bar])
|
|
|
|
~& %scry-43
|
|
|
|
::
|
|
|
|
[~ ~ %noun !>(43)]
|
|
|
|
::
|
|
|
|
=. ford (ford-turbo now=~1234.5.6 eny=0xdead.beef scry=scry-42)
|
2018-03-22 04:27:25 +03:00
|
|
|
=^ moves ford
|
|
|
|
%- call:ford
|
|
|
|
:* duct=~
|
|
|
|
type=~
|
|
|
|
%make
|
|
|
|
~nul
|
2018-03-23 05:17:00 +03:00
|
|
|
plan=[%scry %clay-live care=%x bel=[[~nul %desk] /foo/bar]]
|
2018-03-22 04:27:25 +03:00
|
|
|
date=~
|
|
|
|
==
|
|
|
|
%+ welp
|
|
|
|
%- expect-eq !>
|
|
|
|
:- moves
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.6 %complete %result
|
|
|
|
[%scry %noun !>(42)]
|
|
|
|
==
|
2018-03-22 23:30:44 +03:00
|
|
|
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
|
2018-03-22 04:27:25 +03:00
|
|
|
%c %warp [~nul ~nul] %desk
|
2018-03-22 23:30:44 +03:00
|
|
|
`[%mult [%da ~1234.5.6] (sy [%x /foo/bar]~)]
|
2018-03-22 04:27:25 +03:00
|
|
|
== ==
|
|
|
|
::
|
2018-03-23 05:17:00 +03:00
|
|
|
=. ford (ford now=~1234.5.7 eny=0xbeef.dead scry=scry-43)
|
2018-03-22 23:30:44 +03:00
|
|
|
=^ moves2 ford
|
|
|
|
%- take:ford
|
|
|
|
:* 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-22 04:27:25 +03:00
|
|
|
%- expect-eq !>
|
2018-03-23 05:17:00 +03:00
|
|
|
:- moves2
|
|
|
|
:~ :* duct=~ %give %made ~1234.5.7 %complete %result
|
|
|
|
[%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-03-22 04:27:25 +03:00
|
|
|
:::- state-by-ship.+>+<.ford
|
|
|
|
::(my [~nul *ford-state:ford-turbo]~)
|
2018-03-16 03:21:46 +03:00
|
|
|
--
|