on master help sign in
Check spans and the Hoon references with test arms

tools/check ran four checks through tools/hoon that print their verdict and exit 0 whatever it is: check-spans-test and the three Hoon reference files in tools/testdata. tools/check matched their output against a regex, so they did fail, but only by text, and neither tools/test-arms nor the ship ran them. This is review question 35 (A91); the fifth, itype-unify-test, became the jibb-typecheck suite's arm in d74b5e2. tests/lib/jibb-check-spans.hoon runs +check-spans-test, and tests/lib/jibb-hoon-reference.hoon holds the zing, lead/late and succ references as three arms that name each input they disagree on. Both run under eval in the arms shards and on the ship with the other suites. The three files and the four checks are gone, and so is tools/check's support for checks that print a verdict, which nothing uses now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U4FzmSdubYxmZGDp2VJRAQ

commit32f4b7832151a8cd337dad1e218e97cb3f266b89 authorClaude <noreply@anthropic.com> dateTue 3 Nov 2026, 01:43 (10 hours ago) parentd74b5e2
10 files changed+86−91
docs/compiler.md+1−1 docs/development.md+3−1 docs/status.md+2−1 jibb-dev/lib/jibb.hoon+5−5 tests/lib/jibb-check-spans.hoon+8 tests/lib/jibb-hoon-reference.hoon+60 tools/check+7−33 tools/testdata/lead-late-hoon-reference.hoon−24 tools/testdata/succ-hoon-reference.hoon−9 tools/testdata/zing-hoon-reference.hoon−17
docs/compiler.md+1−1
@@ -156,7 +156,7 @@ Each case's canonical API identity and source-derived schema travel across impor
156156
157157`+golden-types-with-prelude` accepts case-local Jibb module sources alongside `/sur` and mark results and the vendored prelude source. It resolves reachable ordinary library modules in dependency order, caching completed interfaces per invocation and exporting supported closed value schemes, direct generic unions, and simple or nonrecursive generic mold aliases whose bodies the fragment supports. It detects missing sources and cycles and rejects a dependency if its interface cannot be inferred by the fragment. Qualified wings can also read nested fields of an imported value, instantiating that value’s scheme independently at each use; missing, ambiguous and non-record fields remain unsupported.
158158
159−The supplied prelude is parsed into a **partial interface**: all names actually declared in the source are reserved, while only the molds and values this fragment can infer are available. These include the validated standard `list` mold, `unit`, the doc-exact generic `cmd` union, `same`, `fall`, `need`, `bond`, `lure`, `weld`, `snoc`, `turn`, `lent`, `zing`, `flop`, `rear`, `drop`, `skim`, `skip`, `murn`, `join`, `snip`, `levy`, `lien`, `cork`, `corl`, `cury`, `curr`, `lead`, `late`, `trip` and `tuba`; unsupported entries remain unavailable. The validated `list` is injected while the prelude’s gates are inferred; `weld` and `turn` use ordinary explicit result casts. An absent or altered `list` is not injected, and an altered declaration cannot leak through a direct or transitive mold alias. The same validated template is available when prelude mold aliases are prepared, so supported direct and transitive aliases can use it. A named prelude union keeps the fixed `/lib/jibb/prelude/jibb` origin in every module, and its name remains unqualified when a library exports a type containing it. The prelude inventory is incomplete, so reserving the names in this source does not establish complete shadowing coverage. The source-backed internal prelude defines `poke`, which the public prelude re-exports as an ordinary transparent type. A dedicated trusted internal-prelude preparation path also supplies private comparison, arithmetic and text-conversion schemes for the Jibb-written `gth`, `add`, `dec`, `trip` and `tuba` wrappers. Ordinary module resolution rejects that primitive path even if a caller supplies a spoofed root or bundle. The low-level prepared interface is still trusted host input; the host must select the vendored sources and canonicalize paths. Primitive execution and shape-based jet recognition are not implemented. The Jibb-written `lth`, `gte` and `lte` gates compose the source-backed `gth` and `not` gates; supported calls infer a shared atom constraint and return `?`. Their execution and jet recognition await the backend. The source-backed `add` and `dec` wrappers use private arithmetic interfaces whose shared atom variable excludes loobeans; the partial checker preserves that constraint through supported inference and prints `where A is an atom other than ?`. The partial checker resolves the supported `poke` source shape, preserves its public name, and rejects ordinary imports of the private internal path. The Jibb-written `lent` recursively counts a list using `add`; the partial checker infers its generic list argument and `@ud` result. Its execution and jet recognition remain unverified until the backend exists. The Jibb-written `zing` concatenates homogeneous lists in order using `weld`; the checker infers `(list (list A))` to `(list A)`, including for gate elements. Hoon `zing` also accepts heterogeneous noun lists, which this type does not express. `tools/hoon --raw -f tools/testdata/zing-hoon-reference.hoon` compares an equivalent Hoon recursion with Hoon `zing` on selected finite inputs; it does not execute Jibb or verify lowering or jet recognition. The Jibb-written `lead` and `late` are curried pair constructors: `((lead a) b)` returns `[a b]`, while `((late a) b)` returns `[b a]`. The checker infers independent argument types and accepts gates as ordinary values; neither helper invokes an input gate. A Hoon translation is compared with Hoon’s helpers by `tools/hoon --raw -f tools/testdata/lead-late-hoon-reference.hoon`. This does not execute Jibb or verify lowering or jet recognition. An imported API with one mark and a matching direct `+$ poke` declaration can export a derived constructor and retain agent/mark metadata when the source representation has the supported agent case. Other API shapes, complete private module checking, root API and kind checking, stores, complete `ask` and `pure` checking, lowering and runtime effects remain unfinished. A possible store or root API declaring `+$ poke` reports that kind or scope needs unsupported inference; definite duplicate declarations and unrelated shadowing still report conflicts. Prepared interfaces and caches are trusted caller inputs; the future host and linker must ensure the private source validated during preparation is the same version used to lower derived constructors. A `*` payload may contain gates, so the fragment treats it conservatively; full gate-free checks are unfinished. The shared module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship.
159+The supplied prelude is parsed into a **partial interface**: all names actually declared in the source are reserved, while only the molds and values this fragment can infer are available. These include the validated standard `list` mold, `unit`, the doc-exact generic `cmd` union, `same`, `fall`, `need`, `bond`, `lure`, `weld`, `snoc`, `turn`, `lent`, `zing`, `flop`, `rear`, `drop`, `skim`, `skip`, `murn`, `join`, `snip`, `levy`, `lien`, `cork`, `corl`, `cury`, `curr`, `lead`, `late`, `trip` and `tuba`; unsupported entries remain unavailable. The validated `list` is injected while the prelude’s gates are inferred; `weld` and `turn` use ordinary explicit result casts. An absent or altered `list` is not injected, and an altered declaration cannot leak through a direct or transitive mold alias. The same validated template is available when prelude mold aliases are prepared, so supported direct and transitive aliases can use it. A named prelude union keeps the fixed `/lib/jibb/prelude/jibb` origin in every module, and its name remains unqualified when a library exports a type containing it. The prelude inventory is incomplete, so reserving the names in this source does not establish complete shadowing coverage. The source-backed internal prelude defines `poke`, which the public prelude re-exports as an ordinary transparent type. A dedicated trusted internal-prelude preparation path also supplies private comparison, arithmetic and text-conversion schemes for the Jibb-written `gth`, `add`, `dec`, `trip` and `tuba` wrappers. Ordinary module resolution rejects that primitive path even if a caller supplies a spoofed root or bundle. The low-level prepared interface is still trusted host input; the host must select the vendored sources and canonicalize paths. Primitive execution and shape-based jet recognition are not implemented. The Jibb-written `lth`, `gte` and `lte` gates compose the source-backed `gth` and `not` gates; supported calls infer a shared atom constraint and return `?`. Their execution and jet recognition await the backend. The source-backed `add` and `dec` wrappers use private arithmetic interfaces whose shared atom variable excludes loobeans; the partial checker preserves that constraint through supported inference and prints `where A is an atom other than ?`. The partial checker resolves the supported `poke` source shape, preserves its public name, and rejects ordinary imports of the private internal path. The Jibb-written `lent` recursively counts a list using `add`; the partial checker infers its generic list argument and `@ud` result. Its execution and jet recognition remain unverified until the backend exists. The Jibb-written `zing` concatenates homogeneous lists in order using `weld`; the checker infers `(list (list A))` to `(list A)`, including for gate elements. Hoon `zing` also accepts heterogeneous noun lists, which this type does not express. The `test-zing-reference` arm of `tests/lib/jibb-hoon-reference.hoon` compares an equivalent Hoon recursion with Hoon `zing` on selected finite inputs; it does not execute Jibb or verify lowering or jet recognition. The Jibb-written `lead` and `late` are curried pair constructors: `((lead a) b)` returns `[a b]`, while `((late a) b)` returns `[b a]`. The checker infers independent argument types and accepts gates as ordinary values; neither helper invokes an input gate. A Hoon translation is compared with Hoon’s helpers by the same suite's `test-lead-late-reference` arm. This does not execute Jibb or verify lowering or jet recognition. An imported API with one mark and a matching direct `+$ poke` declaration can export a derived constructor and retain agent/mark metadata when the source representation has the supported agent case. Other API shapes, complete private module checking, root API and kind checking, stores, complete `ask` and `pure` checking, lowering and runtime effects remain unfinished. A possible store or root API declaring `+$ poke` reports that kind or scope needs unsupported inference; definite duplicate declarations and unrelated shadowing still report conflicts. Prepared interfaces and caches are trusted caller inputs; the future host and linker must ensure the private source validated during preparation is the same version used to lower derived constructors. A `*` payload may contain gates, so the fragment treats it conservatively; full gate-free checks are unfinished. The shared module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship.
160160
161161`+prepare-prelude` derives the interface and declared-name inventory from the trusted vendored source. Hosts can reuse its result with `+golden-types-with-prepared-prelude`; they must pass the unchanged result of preparation, not an independently constructed value. Empty, malformed and duplicate-name prelude sources fail closed. The source-taking `+prepare-prelude` and `+golden-types-with-prelude` do not supply the internal module; their `-and-internal` or `-with-internal` variants accept its source for the supported private import. API files, modules with `main`, unsupported definitions and many other features remain outside this subset. The older `+golden-types-with-modules` entry point fails closed for imports because it has no prelude scope. None of these partial reports claims the module has been checked.
162162
docs/development.md+3−1
@@ -100,6 +100,7 @@ The `jibb-dev` desk has no `my-app`, so the suites that check `my-app` files rea
100100| `jibb-bridge` | The importer/checker bridge: the Hoon importer composed with the partial checker | `tests/type-import/expected.txt` |
101101| `jibb-buttons` | The documented valid button helpers and the unchanged unresolved-`%add` module, through detailed and legacy inference | `tests/type-buttons/expected.txt` |
102102| `jibb-cell-branch` | Closed-cell branch context, rollback and bounded retry screens | |
103+| `jibb-check-spans` | `+check-spans`, which `+golden` runs on every tree: its own test, `+check-spans-test`, moves the spans of parsed nodes as a parser bug would and checks that it says so | |
103104| `jibb-closed-gate-guards` | Closed gate sample labels and face uncertainty | |
104105| `jibb-constructor-fit-guards` | Constructor-case uncertainty and known mismatches | |
105106| `jibb-deferred` | The bounded source-owned deferred inference transaction | `tests/type-deferred/expected.txt` |
@@ -119,6 +120,7 @@ The `jibb-dev` desk has no `my-app`, so the suites that check `my-app` files rea
119120| `jibb-generic-pattern` | Source-backed recursive patterns, catch-all coverage, state and per-attempt fuel/arm limits | `tests/type-generic-pattern/expected.txt` |
120121| `jibb-generic-recursion` | Source-backed generic recursive identity and provenance | `tests/type-generic-recursion/expected.txt` |
121122| `jibb-hole-guards` | Hole-defaulting and API interface guards | |
123+| `jibb-hoon-reference` | Hoon translations of the Jibb-written `zing`, `lead`, `late` and `succ` against Hoon's own arms, on selected inputs; this does not execute Jibb, test lowering or prove jet recognition | |
122124| `jibb-import` | The partial Hoon importer's diagnostic trees and errors over the importer fixtures; the projection is an internal tree, not the Jibb type printer | `tests/importer/tree.txt` |
123125| `jibb-import-default` | Default-wrapped union source proofs over a real Tlon mold, and adversarial cases | `tests/type-import-default/expected.txt` |
124126| `jibb-import-diagnostic` | The structured reader diagnostic bridge report: definite and unsupported reader diagnostics through the checker | `tests/type-import-diagnostic/expected.txt` |
@@ -160,7 +162,7 @@ tools/check --group eval # only the checks that need no ship, as CI runs the
160162nix flake check # the same checks in the Nix sandbox, on a fresh fake ~zod
161163```
162164
163−`tools/check` runs every check the repo has. Their one list is `CHECKS` in the script, so a new check goes there, as well as in the table above; `tools/check --list` prints it with each check's command. A new suite in `tests/lib` needs no new check: `arms-1` to `arms-4` run every suite's arms, in shards of about equal time, and a slow suite's cost belongs in `COSTS` in `tools/test-arms`, which balances them. The eval group, the 13 checks that need only `urbit` and Python, runs several at a time (`-j`, by default one per CPU), the slowest first. The ship group, `ship-selftest`, `ship-test`, `check-commit` and `clay-fixtures`, then runs one check at a time on the ship `tools/ship` talks to; `tools/check` starts it if it isn't running and stops it again afterwards. Name checks, or globs, to run only those: `tools/check golden 'arms-*'`. To run one suite under eval, use `tools/test-arms <suite>`, as `tools/test-arms jibb-todo-full`. A failing check's output follows its FAIL line; `-v` prints every check's output, and `--logs DIR` keeps it all.
165+`tools/check` runs every check the repo has. Their one list is `CHECKS` in the script, so a new check goes there, as well as in the table above; `tools/check --list` prints it with each check's command. A new suite in `tests/lib` needs no new check: `arms-1` to `arms-4` run every suite's arms, in shards of about equal time, and a slow suite's cost belongs in `COSTS` in `tools/test-arms`, which balances them. The eval group, the 9 checks that need only `urbit` and Python, runs several at a time (`-j`, by default one per CPU), the slowest first. The ship group, `ship-selftest`, `ship-test`, `check-commit` and `clay-fixtures`, then runs one check at a time on the ship `tools/ship` talks to; `tools/check` starts it if it isn't running and stops it again afterwards. Name checks, or globs, to run only those: `tools/check golden 'arms-*'`. To run one suite under eval, use `tools/test-arms <suite>`, as `tools/test-arms jibb-todo-full`. A failing check's output follows its FAIL line; `-v` prints every check's output, and `--logs DIR` keeps it all.
164166
165167CI, [.github/workflows/check.yml](../.github/workflows/check.yml), builds the desks and runs the eval group through the flake on every push to `master` and every pull request. It doesn't run the ship group, so run that before pushing.
166168
docs/status.md+2−1
@@ -293,7 +293,8 @@ tools/test-arms jibb-program-init # transactional direct-program initializer con
293293tools/test-arms jibb-program-update # transactional direct-program update context guards
294294tools/test-arms jibb-program-watch # direct request-value watchability guards
295295tools/test-arms jibb-todo-full # byte-identical full todo and rejection guards
296−tools/hoon check-spans-test # prints <<>> when the span checker works
296+tools/test-arms jibb-check-spans # the span checker catches planted wrong spans
297+tools/test-arms jibb-hoon-reference # Hoon translations of zing, lead, late and succ agree with Hoon's
297298tools/testdata/selftest # the tools themselves
298299tools/doc-blocks docs/spec # the doc's examples are golden cases
299300tools/ship start
jibb-dev/lib/jibb.hoon+5−5
@@ -63,8 +63,8 @@
6363:: finds each node's end from the tokens alone, matching each opener
6464:: with its closer on the line, so a node that stops at a child where
6565:: its closer follows fails it, and +check-spans-test plants such
66−:: wrong ends to show that it does (tools/hoon check-spans-test prints
67−:: the empty list, <<>>, when it passes).
66+:: wrong ends to show that it does (the jibb-check-spans test suite
67+:: runs it).
6868::
6969:: ===================================================================
7070:: 2. The layout pass (+layout)
@@ -4510,9 +4510,9 @@
45104510::
45114511:: Each case parses a source, checks that its spans pass, then moves
45124512:: the span of every node of a kind that starts at a place, as a
4513−:: parser bug would, and checks that +check-spans says so. Run it as
4514−:: tools/hoon check-spans-test, which prints <<>> when every case
4515−:: passes.
4513+:: parser bug would, and checks that +check-spans says so.
4514+:: tests/lib/jibb-check-spans.hoon runs it, under eval with
4515+:: tools/test-arms and on the ship.
45164516::
45174517++ check-spans-test
45184518 ^- (list tape)
tests/lib/jibb-check-spans.hoonnew file+8
@@ -0,0 +1,8 @@
1+:: +check-spans catches the spans a parser bug could give: its own test,
2+:: +check-spans-test, plants wrong ends and starts in parsed sources.
3+/+ jibb
4+|%
5+++ test-check-spans
6+ ^- tang
7+ (turn check-spans-test:jibb |=(reason=tape leaf+reason))
8+--
tests/lib/jibb-hoon-reference.hoonnew file+60
@@ -0,0 +1,60 @@
1+:: Hoon translations of Jibb prelude gates against the Hoon arms they
2+:: stand for: zing, lead and late, and succ. They don't execute Jibb,
3+:: test lowering or prove jet recognition.
4+|%
5+:: +zing: Jibb's recursion, translated, against Hoon's zing
6+++ test-zing-reference
7+ ^- tang
8+ =/ flatten
9+ |= xss=(list (list @ud))
10+ ^- (list @ud)
11+ ?~ xss ~
12+ (weld i.xss $(xss t.xss))
13+ =/ cases=(list (list (list @ud)))
14+ :~ ~
15+ ~[~]
16+ ~[~[1 2] ~ ~[3]]
17+ ~[~[0] ~[3 2 1] ~]
18+ ==
19+ %+ murn cases
20+ |= xss=(list (list @ud))
21+ ?: =((flatten xss) (zing xss)) ~
22+ `leaf+"flattening differs from zing on {<xss>}"
23+:: +lead and +late: curried pair constructors, translated, against Hoon's
24+:: on every pair of five nouns, a gate among them
25+++ test-lead-late-reference
26+ ^- tang
27+ =/ make-lead |=(a=* |=(b=* [a b]))
28+ =/ make-late |=(b=* |=(a=* [a b]))
29+ :: Each noun has a name for the failure message: printing a gate
30+ :: would print its whole subject.
31+ =/ items=(list [name=tape noun=*])
32+ :~ ["0" 0]
33+ ["1" 1]
34+ ["'hello'" 'hello']
35+ ["[1 2]" [1 2]]
36+ ["a gate" |=(x=@ud x)]
37+ ==
38+ %- zing
39+ %+ turn items
40+ |= [xn=tape x=*]
41+ %+ murn items
42+ |= [yn=tape y=*]
43+ ?. =(((make-lead x) y) ((lead x) y))
44+ `leaf+"lead differs on {xn} and {yn}"
45+ ?. =(((make-late x) y) ((late x) y))
46+ `leaf+"late differs on {xn} and {yn}"
47+ ~
48+:: +succ: the successor, translated, against Hoon's succ
49+++ test-succ-reference
50+ ^- tang
51+ =/ next |=(x=@ (add x 1))
52+ =/ values=(list @)
53+ :~ 0 1 2 31 255 256 65.535 65.536 4.294.967.295
54+ 18.446.744.073.709.551.615
55+ ==
56+ %+ murn values
57+ |= x=@
58+ ?: =((next x) (succ x)) ~
59+ `leaf+"successor differs from succ on {<x>}"
60+--
tools/check+7−33
@@ -19,11 +19,9 @@ order, on the ship tools/ship talks to: $JIBB_PIER, or /root/urbit/zod
1919(tools/ship also reads $JIBB_CLICK and $JIBB_SHIP_LOG). When that ship
2020isn't running, tools/check starts it first and stops it again at the end.
2121
22−Each check is one command, run from the repo root. It passes when it
23−exits 0 and, for the few that print their verdict rather than exit with
24−it, when its output matches what the list expects. Output is kept and
25−printed only for a check that fails (all of it with -v); --logs DIR
26−keeps every check's output in DIR/<name>.log.
22+Each check is one command, run from the repo root, and passes when it
23+exits 0. Output is kept and printed only for a check that fails (all of
24+it with -v); --logs DIR keeps every check's output in DIR/<name>.log.
2725
2826Exit status: 0 when every check ran and passed, 1 when a check failed,
29272 when the checks couldn't run (an unknown name, a ship that won't start).
@@ -47,11 +45,10 @@ SHIP = os.path.join('tools', 'ship')
4745
4846
4947class Check:
50− def __init__(self, name, group, command, expect=None):
48+ def __init__(self, name, group, command):
5149 self.name = name
5250 self.group = group # 'eval' or 'ship'
5351 self.command = command # argv, run from ROOT
54− self.expect = expect # a regex stdout must match in full
5552
5653 def shown(self):
5754 return ' '.join(c if re.match(r'^[\w./=-]+$', c) else "'%s'" % c
@@ -64,11 +61,6 @@ def tool(name, group='eval', *args):
6461 return Check(base, group, [os.path.join('tools', name)] + list(args))
6562
6663
67−def hoon(name, *args, expect):
68− """A check that runs tools/hoon and compares what it prints."""
69− return Check(name, 'eval', ['tools/hoon'] + list(args), expect=expect)
70−
71−
7264# Every check, in the order they start: the eval group, slowest first,
7365# then the ship group, in the order they must run. Times are from one
7466# run on four CPUs (2026-11-03).
@@ -88,17 +80,6 @@ CHECKS = [
8880 for i in range(1, ARM_SHARDS + 1)
8981] + [
9082 Check('my-app-copies', 'eval', ['tools/test-arms', '--copies']),
91− # These print their verdict and exit 0 either way.
92− hoon('check-spans-test', 'check-spans-test', expect=r'<<>>\n'),
93− hoon('zing-hoon-reference', '-f',
94− 'tools/testdata/zing-hoon-reference.hoon',
95− expect=r"'Hoon flattening reference: \d+ cases passed'\n"),
96− hoon('lead-late-hoon-reference', '-f',
97− 'tools/testdata/lead-late-hoon-reference.hoon',
98− expect=r"'Hoon lead/late reference: \d+ comparisons passed'\n"),
99− hoon('succ-hoon-reference', '-f',
100− 'tools/testdata/succ-hoon-reference.hoon',
101− expect=r"'Hoon successor reference: \d+ comparisons passed'\n"),
10283 Check('doc-blocks', 'eval', ['tools/doc-blocks', 'docs/spec']),
10384 tool('testdata/clay-fixtures-selftest'),
10485 # The ship group. ship-selftest leaves its fixture files on the
@@ -139,12 +120,11 @@ def run(check, timeout, env):
139120 """Run one check; a Result."""
140121 res = Result(check)
141122 start = time.time()
142− with tempfile.TemporaryFile() as out, tempfile.TemporaryFile() as err:
123+ with tempfile.TemporaryFile() as out:
143124 try:
144125 proc = subprocess.Popen(
145126 check.command, cwd=ROOT, env=env, stdin=subprocess.DEVNULL,
146− stdout=out,
147− stderr=err if check.expect is not None else subprocess.STDOUT,
127+ stdout=out, stderr=subprocess.STDOUT,
148128 start_new_session=True)
149129 except OSError as e:
150130 res.why = 'could not run %s: %s' % (check.command[0], e)
@@ -162,18 +142,12 @@ def run(check, timeout, env):
162142 _running.discard(proc.pid)
163143 kill(proc.pid) # anything it left running, such as urbit eval
164144 out.seek(0)
165− err.seek(0)
166− stdout = out.read().decode('utf-8', 'replace')
167− stderr = err.read().decode('utf-8', 'replace')
145+ res.output = out.read().decode('utf-8', 'replace')
168146 res.seconds = time.time() - start
169− res.output = stdout + stderr
170147 if res.why:
171148 return res
172149 if res.status != 0:
173150 res.why = 'exit status %d' % res.status
174− elif check.expect is not None and \
175− not re.fullmatch(check.expect, stdout):
176− res.why = "it didn't print the verdict that means a pass"
177151 else:
178152 res.ok = True
179153 return res
tools/testdata/lead-late-hoon-reference.hoondeleted−24
@@ -1,24 +0,0 @@
1−:: Hoon translations of curried Jibb pair constructors vs Hoon 2n arms.
2−:: This does not execute Jibb, lower code or verify jet recognition.
3−^- @t
4−=/ make-lead |= a=* |= b=* [a b]
5−=/ make-late |= b=* |= a=* [a b]
6−=/ items=(list *)
7− :~ 0
8− 1
9− 'hello'
10− [1 2]
11− |=(x=@ud x)
12− ==
13−=/ xs=(list *) items
14−|-
15−?~ xs 'Hoon lead/late reference: 50 comparisons passed'
16−=/ ys=(list *) items
17−=/ good=?
18− |-
19− ?~ ys &
20− ?. =(((make-lead i.xs) i.ys) ((lead i.xs) i.ys)) |
21− ?. =(((make-late i.xs) i.ys) ((late i.xs) i.ys)) |
22− $(ys t.ys)
23−?. good 'BAD pair mismatch'
24−$(xs t.xs)
tools/testdata/succ-hoon-reference.hoondeleted−9
@@ -1,9 +0,0 @@
1−:: Compare a Hoon translation of the Jibb successor with Hoon's 2n arm.
2−:: This does not execute Jibb, lower code or verify jet recognition.
3−^- @t
4−=/ next |= x=@ (add x 1)
5−=/ values=(list @) ~[0 1 2 31 255 256 65.535 65.536 4.294.967.295 18.446.744.073.709.551.615]
6−|- ^- @t
7−?~ values 'Hoon successor reference: 10 comparisons passed'
8−?. =((next i.values) (succ i.values)) 'BAD successor mismatch'
9−$(values t.values)
tools/testdata/zing-hoon-reference.hoondeleted−17
@@ -1,17 +0,0 @@
1−:: Compare a Hoon translation of Jibb zing's recursion with Hoon's zing.
2−:: This does not run Jibb, test lowering, or prove jet recognition.
3−^- @t
4−=/ flatten |= xss=(list (list @ud))
5− ^- (list @ud)
6− ?~ xss ~
7− (weld i.xss $(xss t.xss))
8−=/ cases=(list (list (list @ud)))
9− :~ ~
10− ~[~]
11− ~[~[1 2] ~ ~[3]]
12− ~[~[0] ~[3 2 1] ~]
13− ==
14−|-
15−?~ cases 'Hoon flattening reference: 4 cases passed'
16−?. =((flatten i.cases) (zing i.cases)) 'BAD Hoon flattening mismatch'
17−$(cases t.cases)