urbit/gen/ford-turbo.hoon

133 lines
2.9 KiB
Plaintext
Raw Normal View History

2018-03-16 03:21:46 +03:00
/+ ford-turbo, tester
::
:- %say
|= [[now=@da eny=@ =beak] ~ ~]
:- %noun
=+ our=p.beak
=+ 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
test-unify-jugs
2018-03-20 04:03:18 +03:00
test-literal
test-autocons-same
test-autocons-different
2018-03-20 22:01:49 +03:00
test-scry-clay
2018-03-16 03:21:46 +03:00
==
++ test-compiles
~& %test-compiles
%- expect-eq !>
[ford-turbo ford-turbo]
::
++ 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-20 04:03:18 +03:00
++ test-literal
~& %test-literal
=^ 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-16 03:21:46 +03:00
%- expect-eq !>
:- 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
::
++ test-scry-clay
~& %test-scry-clay
=/ 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-16 03:21:46 +03:00
--