Skip to content

Commit

Permalink
Implement basic Hoon testing pattern. (#11)
Browse files Browse the repository at this point in the history
* Fix preliminaries like else keyword.

* WIP but commit version in issue #10

* Post working testing framework.

* Post generated tests.

* Post with jamfile.

* Post checked testing pattern.

* Post instructions.
  • Loading branch information
sigilante authored Nov 25, 2024
1 parent 12fb7b9 commit eba0ce2
Show file tree
Hide file tree
Showing 28 changed files with 2,658 additions and 48 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ make release
./target/release/jock-testing test-all
```

This will execute all of the supplied programs, then run unit tests over each of the compilation steps in producing each program's Nock.
Binary file modified assets/jocktest.jam
Binary file not shown.
17 changes: 14 additions & 3 deletions hoon/lib/jock.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,18 @@
::
+$ tokens (list token)
::
++ gae ;~(pose gaw (easy ~))
++ val %+ cold ~
;~ plug fas fas
(star prn)
(just `@`10)
==
++ var %+ cold ~
;~ plug ;~(plug fas tar)
(star ;~(less ;~(plug tar fas) prn))
;~(plug tar fas)
==
++ gav (cold ~ (star ;~(pose val var gah)))
++ gae ;~(pose gav (easy ~))
::
++ tokenize
|%
Expand Down Expand Up @@ -110,7 +121,7 @@
tagged-name
==
::
++ tokens (star ;~(pose token ;~(pfix gaw token)))
++ tokens (star ;~(pose token ;~(pfix gav token)))
--
::
++ parse-tokens
Expand Down Expand Up @@ -677,7 +688,7 @@
=^ then tokens
(match-block [tokens %'{' %'}'] match-jock)
=^ after-if tokens
(match-after-if-expression +.tokens)
(match-after-if-expression tokens)
[[%else-if cond then after-if] tokens]
::
++ match-literal
Expand Down
Loading

0 comments on commit eba0ce2

Please sign in to comment.