Fix test expectation issue local to the ford tests.

This commit is contained in:
Elliot Glaysher 2018-05-07 14:15:24 -07:00
parent 1694f95eee
commit 3ad4704ffc

View File

@ -5,7 +5,7 @@
:- %noun :- %noun
=+ tester:tester =+ tester:tester
|^ |^
=- ((slog (flop -)) ~) =- ((slog -) ~)
^- tang ^- tang
;: weld ;: weld
test-is-schematic-live test-is-schematic-live
@ -102,11 +102,12 @@
=/ ford (ford-turbo now=~1234.5.6 eny=0xdead.beef scry=scry-is-forbidden) =/ ford (ford-turbo now=~1234.5.6 eny=0xdead.beef scry=scry-is-forbidden)
:: ::
%- expect-eq !> %- expect-eq !>
:- %+ unify-jugs:ford :- ^- (jug @tas @ud)
`(jug @tas @ud)`(my ~[[%a (sy 1 2 ~)] [%b (sy 3 4 ~)]]) (my ~[[%a (sy 1 2 ~)] [%b (sy 3 4 5 6 ~)] [%c (sy 7 8 ~)]])
`(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 ~)]]) %+ 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 ~)]])
:: ::
++ test-resource-wire-encoding ++ test-resource-wire-encoding
~& %test-resource-wire-encoding ~& %test-resource-wire-encoding
@ -115,21 +116,21 @@
:: ::
;: welp ;: welp
%- expect-eq !> %- expect-eq !>
:- `path`(resource-to-path:ford [%c care=%x bel=[[~nul %desk] /foo/bar]]) :_ `path`(resource-to-path:ford [%c care=%x [[~nul %desk] /foo/bar]])
/cx/~nul/desk/0/bar/foo /cx/~nul/desk/0/bar/foo
:: ::
%- expect-eq !> %- expect-eq !>
:- `resource:ford`[%c care=%x bel=[[~nul %desk] /foo/bar]] :_ `resource:ford`[%c care=%x [[~nul %desk] /foo/bar]]
(need (path-to-resource:ford /cx/~nul/desk/0/bar/foo)) (need (path-to-resource:ford /cx/~nul/desk/0/bar/foo))
:: ::
%- expect-eq !> %- expect-eq !>
:- ^- path :_ ^- path
(resource-to-path:ford [%g care=%x bel=[[~nul %desk] /foo/bar]]) (resource-to-path:ford [%g care=%x [[~nul %desk] /foo/bar]])
/gx/~nul/desk/0/bar/foo /gx/~nul/desk/0/bar/foo
:: ::
%- expect-eq !> %- expect-eq !>
:- ^- resource:ford :_ ^- resource:ford
[%g care=%x bel=[[~nul %desk] /foo/bar]] [%g care=%x [[~nul %desk] /foo/bar]]
(need (path-to-resource:ford /gx/~nul/desk/0/bar/foo)) (need (path-to-resource:ford /gx/~nul/desk/0/bar/foo))
== ==
:: ::
@ -476,7 +477,7 @@
:: ::
=/ results2=tang =/ results2=tang
%- expect-eq !> %- expect-eq !>
:- results:(~(got by state-by-ship.+>+<.ford) ~nul) :_ results:(~(got by state-by-ship.+>+<.ford) ~nul)
%- my :~ %- my :~
:- [~1234.5.6 [%scry %c care=%x rail=[[~nul %desk] /bar/foo]]] :- [~1234.5.6 [%scry %c care=%x rail=[[~nul %desk] /bar/foo]]]
[%value ~1234.5.6 %success %scry %noun !>(42)] [%value ~1234.5.6 %success %scry %noun !>(42)]
@ -1186,15 +1187,15 @@
:: Types can't be compared using simple equality, so normalize the :: Types can't be compared using simple equality, so normalize the
:: type to check the rest of the move. :: type to check the rest of the move.
:: ::
:- i.moves(&8 *type) :_ i.moves(&8 *type)
:* duct=~[/dead] %give %made ~1234.5.6 %complete :* duct=~[/dead] %give %made ~1234.5.6 %complete
[%success [%ride *type 5]] [%success [%ride *type 5]]
== ==
:: make sure the returned type nests :: make sure the returned type nests
:: ::
%- expect-eq !> %- expect-eq !>
:- (~(nest ut &8:i.moves) | -:!>(*@)) :- &
& (~(nest ut &8:i.moves) | -:!>(*@))
== ==
:: ::
=^ results2 ford =^ results2 ford
@ -1248,14 +1249,14 @@
:: Types can't be compared using simple equality, so normalize the :: Types can't be compared using simple equality, so normalize the
:: type to check the rest of the move. :: type to check the rest of the move.
:: ::
:- i.moves(&8 *type) :_ i.moves(&8 *type)
:* duct=~[/dead] %give %made ~1234.5.6 %complete :* duct=~[/dead] %give %made ~1234.5.6 %complete
[%success [%ride *type 42]] [%success [%ride *type 42]]
== ==
:: ::
%- expect-eq !> %- expect-eq !>
:- (~(nest ut &8:i.moves) | -:!>(*@)) :- &
& (~(nest ut &8:i.moves) | -:!>(*@))
== ==
:: ::
=^ results2 ford =^ results2 ford
@ -1305,7 +1306,7 @@
%- expect-eq !> %- expect-eq !>
:: compare the move to the expected move, omitting check on stack trace :: compare the move to the expected move, omitting check on stack trace
:: ::
:- i.moves(|7 ~) :_ i.moves(|7 ~)
:* duct=~[/dead] %give %made ~1234.5.6 %complete :* duct=~[/dead] %give %made ~1234.5.6 %complete
[%error [leaf+"ford: %ride failed:" ~]] [%error [leaf+"ford: %ride failed:" ~]]
== == == ==
@ -1380,15 +1381,15 @@
:: Types can't be compared using simple equality, so normalize the :: Types can't be compared using simple equality, so normalize the
:: type to check the rest of the move. :: type to check the rest of the move.
:: ::
:- i.moves(&8 *type) :_ i.moves(&8 *type)
:* duct=~[/live] %give %made ~1234.5.6 %complete :* duct=~[/live] %give %made ~1234.5.6 %complete
[%success [%ride *type 42]] [%success [%ride *type 42]]
== ==
:: make sure the types nest :: make sure the types nest
:: ::
%- expect-eq !> %- expect-eq !>
:- (~(nest ut &8:i.moves) | -:!>(*@)) :- &
& (~(nest ut &8:i.moves) | -:!>(*@))
== ==
:: ::
=^ results3 ford =^ results3 ford
@ -1541,7 +1542,7 @@
contents="post-a-contents" contents="post-a-contents"
== ==
%- expect-eq !> %- expect-eq !>
:- i.t.moves :_ i.t.moves
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
%c %warp [~nul ~nul] %desk %c %warp [~nul ~nul] %desk
`[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)] `[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)]
@ -2310,7 +2311,7 @@
contents="post-a-contents" contents="post-a-contents"
== ==
%- expect-eq !> %- expect-eq !>
:- i.t.moves :_ i.t.moves
:* duct=~ %pass wire=/~nul/clay-sub/~nul/desk :* duct=~ %pass wire=/~nul/clay-sub/~nul/desk
%c %warp [~nul ~nul] %desk %c %warp [~nul ~nul] %desk
`[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)] `[%mult [%da ~1234.5.6] (sy [%x /posts/a] [%x /posts/b] ~)]
@ -2364,7 +2365,9 @@
|= moves=(list move:ford-turbo) |= moves=(list move:ford-turbo)
^- tang ^- tang
:: ::
:: ~| %didnt-get-two-moves
?> ?=([^ ^ ~] moves) ?> ?=([^ ^ ~] moves)
::
%- check-post-made :* %- check-post-made :*
move=i.moves move=i.moves
duct=~[/post-a] duct=~[/post-a]
@ -2429,34 +2432,34 @@
:: ::
;: welp ;: welp
%- expect-eq !> %- expect-eq !>
[duct.move duct] [duct duct.move]
:: ::
%- expect-eq !> %- expect-eq !>
[date.p.card.move date] [date date.p.card.move]
:: ::
%- expect-eq !> %- expect-eq !>
:- head.result(p.q.cage *^type) :_ head.result(p.q.cage *^type)
[%success %scry %noun *^type [title=title contents=contents]] [%success %scry %noun *^type [title=title contents=contents]]
:: ::
%- expect-eq !> %- expect-eq !>
:- (~(nest ut p.q.cage.head.result) | type) :- &
& (~(nest ut p.q.cage.head.result) | type)
:: ::
%- expect-eq !> %- expect-eq !>
:- head.tail.result(p.vase *^type) :- [%success %ride *^type 'post-a']
[%success %ride *^type 'post-a'] head.tail.result(p.vase *^type)
:: ::
%- expect-eq !> %- expect-eq !>
:- (~(nest ut p.vase.head.tail.result) | -:!>('')) :- &
& (~(nest ut p.vase.head.tail.result) | -:!>(''))
:: ::
%- expect-eq !> %- expect-eq !>
:- tail.tail.result(p.vase *^type) :- [%success %ride *^type 'post-b']
[%success %ride *^type 'post-b'] tail.tail.result(p.vase *^type)
:: ::
%- expect-eq !> %- expect-eq !>
:- (~(nest ut p.vase.tail.tail.result) | -:!>('')) :- &
& (~(nest ut p.vase.tail.tail.result) | -:!>(''))
== ==
:: ::
:: +scry-with-results :: +scry-with-results
@ -2539,8 +2542,8 @@
:: ::
=/ output=tang =/ output=tang
%- expect-eq !> %- expect-eq !>
:- moves :- expected-moves
expected-moves moves
:: ::
[output ford] [output ford]
:: ::
@ -2560,8 +2563,8 @@
:: ::
=/ output=tang =/ output=tang
%- expect-eq !> %- expect-eq !>
:- moves :- expected-moves
expected-moves moves
:: ::
[output ford] [output ford]
:: +test-ford-call-with-comparator :: +test-ford-call-with-comparator
@ -2614,6 +2617,6 @@
|= [ford=_(ford-turbo) ship=@p] |= [ford=_(ford-turbo) ship=@p]
^- tang ^- tang
%- expect-eq !> %- expect-eq !>
:- state-by-ship.+>+<.ford :- (my [ship *ford-state:ford-turbo]~)
(my [ship *ford-state:ford-turbo]~) state-by-ship.+>+<.ford
-- --