Execute /, in scaffolds

This commit is contained in:
Elliot Glaysher 2018-05-21 13:34:56 -07:00
parent a6497ad061
commit f9a4c8791b
2 changed files with 87 additions and 0 deletions

View File

@ -93,6 +93,7 @@
test-core-fsbr-out-of-options
test-plan-fszp-as-noun
test-core-fscl-fszp
test-core-fscm
test-bunt
==
++ test-tear
@ -4616,6 +4617,77 @@
(expect-ford-empty ford ~nul)
==
::
++ test-core-fscm
:- `tank`leaf+"test-core-fscm"
::
=/ ford *ford-gate
::
=/ hoon-src-type=type [%atom %$ ~]
=/ scry-results=(map [term beam] cage)
%- my :~
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/program/gen]]
:- %hoon
:- hoon-src-type
'''
/= data /: /===/data/hoon
/!noun/
data
'''
::
:- [%cx [[~nul %home %da ~1234.5.6] /hoon/data]]
:- %hoon
:- hoon-src-type
'''
/, /other/hoon
/~ a=[3 2 1 ~]
::
/data/hoon
/~ a=[1 2 3 ~]
==
a
'''
==
::
=^ results1 ford
%- test-ford-call-with-comparator :*
ford
now=~1234.5.6
scry=(scry-with-results scry-results)
::
::
^= call-args
:* duct=~[/path] type=~ %make ~nul
%pin ~1234.5.6
[%core source-path=`rail:ford-gate`[[~nul %home] /hoon/program/gen]]
==
::
^= comparator
|= moves=(list move:ford-gate)
::
?> =(1 (lent moves))
?> ?=(^ moves)
?> ?=([* %give %made @da %complete %success %pin *] i.moves)
=/ result result.p.card.i.moves
=/ pin-result build-result.result
?> ?=([%success %core *] build-result.pin-result)
::
=/ =vase vase.build-result.pin-result
::
%+ weld
%- expect-eq !>
:- [1 2 3 ~]
q.vase
::
%- expect-eq !>
:- &
(~(nest ut p.vase) | -:!>([1 2 3 ~]))
==
::
;: weld
results1
(expect-ford-empty ford ~nul)
==
::
++ test-bunt
:- `tank`leaf+"test-bunt"
::

View File

@ -3157,6 +3157,7 @@
%fssg (run-fssg +.crane)
%fsbr (run-fsbr +.crane)
%fsts (run-fsts +.crane)
%fscm (run-fscm +.crane)
%fsdt (run-fsdt +.crane)
%fssm (run-fssm +.crane)
%fscl (run-fscl +.crane)
@ -3202,6 +3203,20 @@
[child ..run-crane]
:_ ..run-crane
[%subject [[%face [~ face] p.subject.child] q.subject.child]]
:: +run-fscm: runs the `/,` rune
::
++ run-fscm
|= cases=(list [=spur crane=^crane])
^- compose-cranes
::
?~ cases
[[%error [leaf+"/, failed: no match"]~] ..run-crane]
::
?. .= spur.i.cases
(scag (lent spur.i.cases) (flop spur.path-to-render))
$(cases t.cases)
::
(run-crane subject crane.i.cases)
:: +run-fsdt: runs the `/.` rune
::
++ run-fsdt