on master help sign in
Default decimal values and isolate import fixture failures
2d5deb2iko
README.md+3−3
@@ -16,7 +16,7 @@ Milestone 1 of the doc's eight, the parser and the `%jibb` mark, is done; milest
16
16
17## Golden tests
17## Golden tests
18
18
19−Each case, `tests/golden/<case>/`, holds `source.jibb`, `about.txt` (where it comes from, what it tests, the expected outcome), and the expected outputs: `tokens.txt` from the layout pass and `tree.txt` from the parser. A file holds the output plus one trailing newline. A case may also have a `path.txt` specifying its logical `/ui/.../*.jibb` path. An `expect-types:` line in `about.txt` opts it into the provisional `golden-types` checker output in `types.txt`; `--update` creates it. A case can select Hoon molds in `imports.txt` and provide each module in `sur/<module>.txt`, as described in [docs/development.md](docs/development.md).
19+Each case, `tests/golden/<case>/`, holds `source.jibb`, `about.txt` (where it comes from, what it tests, the expected outcome), and the expected outputs: `tokens.txt` from the layout pass and `tree.txt` from the parser. A file holds the output plus one trailing newline. A case may also have a `path.txt` specifying its logical `/ui/.../*.jibb` path. An `expect-types:` line in `about.txt` opts it into the provisional `golden-types` checker output in `types.txt`; `--update` creates it. A case can select Hoon molds in `imports.txt` and provide each module in `sur/<module>.txt`, or select marks in `marks.txt` and provide their source in `mar/<name>.txt`, as described in [docs/development.md](docs/development.md).
20
20
21Run them without a ship. This needs `urbit` on PATH and Python 3.
21Run them without a ship. This needs `urbit` on PATH and Python 3.
22
22
@@ -42,7 +42,7 @@ tools/hoon '(golden /a/b/jibb (crip "++ main view"))'
42tools/hoon --raw --cord src=tests/golden/foo/source.jibb 'tree:(golden /a/b/jibb src)'
42tools/hoon --raw --cord src=tests/golden/foo/source.jibb 'tree:(golden /a/b/jibb src)'
43```
43```
44
44
45−`tools/testdata/selftest` tests both tools against a stub library, and `tools/doc-blocks` against Markdown it writes. `tools/importer-test` compares the partial Hoon importer's fixture projections against their golden file. `tools/type-import-test` checks the importer/checker bridge under eval; the ship suite runs the same fixture.
45+`tools/testdata/selftest` tests both tools against a stub library, and `tools/doc-blocks` against Markdown it writes. `tools/importer-test` compares the partial Hoon importer's fixture projections against their golden file. `tools/type-import-test` and `tools/type-mark-test` check the importer/checker bridges under eval; the ship suite runs the same fixtures.
46
46
47### The doc's examples
47### The doc's examples
48
48
@@ -86,7 +86,7 @@ A sync with nothing to commit takes about 2 s. A commit adds 3 to 10 s, and 300
86
86
87`tools/ship check-commit` proves that `|commit` stores `.jibb` files. It syncs `my-app`, reads every `/ui` file back with `%cx`, byte for byte, and converts `%jibb` to `%mime` and `%txt` and back. It commits half-written files, then deletes them. It merges a file that two desks changed on different lines, and checks that changes to the same line conflict. It can be rerun, and it leaves the two scratch desks it merges with (`%jibb-check-ours` and `%jibb-check-theirs`) holding only what `|new-desk` gives, unmounted.
87`tools/ship check-commit` proves that `|commit` stores `.jibb` files. It syncs `my-app`, reads every `/ui` file back with `%cx`, byte for byte, and converts `%jibb` to `%mime` and `%txt` and back. It commits half-written files, then deletes them. It merges a file that two desks changed on different lines, and checks that changes to the same line conflict. It can be rerun, and it leaves the two scratch desks it merges with (`%jibb-check-ours` and `%jibb-check-theirs`) holding only what `|new-desk` gives, unmounted.
88
88
89−`tools/clay-fixtures` syncs `my-app`, builds its example `/sur` files and marks through Clay, and checks selected molds read from the compiled `/sur` type graphs. It compares both results with golden files under `tests/clay-fixtures/`.
89+`tools/clay-fixtures` syncs `my-app`, builds its example `/sur` files and marks through Clay, and checks selected types read from the compiled graphs and passed to the partial checker. It compares the results with golden files under `tests/clay-fixtures/`.
90
90
91For anything else:
91For anything else:
92
92
docs/compiler.md+3−1
@@ -56,10 +56,12 @@ The core is split into chapters, `+| %name`, in this order:
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
58
58
59−The inference fragment supports fixed auras, unrestricted `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, unfaced cells, a two-binder cell pattern, a complete two-arm loobean branch, closed local mold aliases and acyclic forward value references. It instantiates generalized top-level definitions when they are used. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Numeric defaulting and other constraint cases remain incomplete. It does not yet check a module, its imports, faces, general patterns, deferred constraints, recursive or generic molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types. The current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
59+The inference fragment supports fixed auras, unrestricted `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, unfaced cells, a two-binder cell pattern, a complete two-arm loobean branch, closed local mold aliases and acyclic forward value references. It instantiates generalized top-level definitions when they are used. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Unresolved decimal variables default to `@ud` for inferred types without gates; defaulting inside gate types and other constraint cases remain incomplete. It does not yet check a module, its imports, faces, general patterns, deferred constraints, recursive or generic molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types. The current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
60
60
61The separate `jibb-dev/lib/jibb-import.hoon` is an unfinished reader for selected Hoon type graphs. It handles named recursion, nested map, set, queue, list, unit, jar and jug arguments, direct ordered maps, and direct `$^` unions whose source branches can be proved disjoint. It also reads ordered map fields in records when the map arguments are syntactically fixed atom molds and other fields are fixed atom molds or standard collections of static atom molds. Collection names must not be shadowed. The reader can also import a nonrecursive mark door sample, removing its outer sample face and validating its build subject; recursive mark samples fail closed until their source modules are tracked. Nested `$^`, other nested ordered maps, general source-level disjointness and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms and unfaced cells from caller-supplied reader results for declared `/-` imports; `+golden-types-with-marks` accepts those same shapes from declared mark imports in a separate list. Other forms remain unsupported. Its disjointness proof is conservative and can reject a valid union it cannot prove disjoint. Collection recognition requires the originating `/sur` core. The reader validates direct zuse subjects and Ford subjects consisting of faced imported cores and a validated tail, checking imported cores transitively; it rejects shadowed names, inconsistent core subjects and other subject shapes. Recursive results with Ford imports are rejected until references retain their source module. Its fixtures include three real Tlon files; `tools/importer-test` compares the internal projection under eval, and the ship test compares the same golden output. `tools/type-import-test` and `tools/type-mark-test` compare bridge reports under eval and on the ship. `tools/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
61The separate `jibb-dev/lib/jibb-import.hoon` is an unfinished reader for selected Hoon type graphs. It handles named recursion, nested map, set, queue, list, unit, jar and jug arguments, direct ordered maps, and direct `$^` unions whose source branches can be proved disjoint. It also reads ordered map fields in records when the map arguments are syntactically fixed atom molds and other fields are fixed atom molds or standard collections of static atom molds. Collection names must not be shadowed. The reader can also import a nonrecursive mark door sample, removing its outer sample face and validating its build subject; recursive mark samples fail closed until their source modules are tracked. Nested `$^`, other nested ordered maps, general source-level disjointness and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms and unfaced cells from caller-supplied reader results for declared `/-` imports; `+golden-types-with-marks` accepts those same shapes from declared mark imports in a separate list. Other forms remain unsupported. Its disjointness proof is conservative and can reject a valid union it cannot prove disjoint. Collection recognition requires the originating `/sur` core. The reader validates direct zuse subjects and Ford subjects consisting of faced imported cores and a validated tail, checking imported cores transitively; it rejects shadowed names, inconsistent core subjects and other subject shapes. Recursive results with Ford imports are rejected until references retain their source module. Its fixtures include three real Tlon files; `tools/importer-test` compares the internal projection under eval, and the ship test compares the same golden output. `tools/type-import-test` and `tools/type-mark-test` compare bridge reports under eval and on the ship. `tools/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
62
62
63+Callers that have a `/sur` core and a name can use `+read-named`: it checks for a locally declared arm before asking Hoon to evaluate the mold, and reports evaluation failures with the final Hoon trace line. `+read-mold-in` remains available when the caller already has the selected type. The checker currently treats a failed import as unsupported rather than rendering the importer's error.
64+
63And the design notes:
65And the design notes:
64
66
65| Note | Says |
67| Note | Says |
docs/development.md+4−2
@@ -79,7 +79,7 @@ tools/importer-test # Hoon importer fixture projections match
79tools/type-import-test # importer/checker bridge golden report matches
79tools/type-import-test # importer/checker bridge golden report matches
80tools/type-mark-test # mark/checker bridge golden report matches
80tools/type-mark-test # mark/checker bridge golden report matches
81tools/hoon check-spans-test # prints <<>>
81tools/hoon check-spans-test # prints <<>>
82−tools/testdata/selftest # 19 checks, 0 failed
82+tools/testdata/selftest # 20 checks, 0 failed
83tools/doc-blocks docs/spec # every jibb block has its case
83tools/doc-blocks docs/spec # every jibb block has its case
84tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
84tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
85tools/ship test # the cases pass as -test arms on the ship
85tools/ship test # the cases pass as -test arms on the ship
@@ -99,7 +99,9 @@ A case is a folder `tests/golden/<name>/` holding:
99- the expected outputs, `tokens.txt` and `tree.txt`, each the output plus one newline.
99- the expected outputs, `tokens.txt` and `tree.txt`, each the output plus one newline.
100- optionally, `path.txt`, the logical `/ui/.../*.jibb` path to pass to the compiler; the source remains `source.jibb`.
100- optionally, `path.txt`, the logical `/ui/.../*.jibb` path to pass to the compiler; the source remains `source.jibb`.
101- optionally, an `expect-types:` line in `about.txt` opts the case into `+golden-types`; `types.txt` holds its output plus one newline and `--update` creates it. A `types.txt` also opts in when the line is absent. This interface is provisional while the checker is under construction.
101- optionally, an `expect-types:` line in `about.txt` opts the case into `+golden-types`; `types.txt` holds its output plus one newline and `--update` creates it. A `types.txt` also opts in when the line is absent. This interface is provisional while the checker is under construction.
102−- optionally, `imports.txt` selects Hoon `/sur` molds, one `module mold` pair per line. Each module's source goes in `sur/<module>.txt` and is compiled against zuse by both runners. `marks.txt` selects marks, one name per line, with source in `mar/<name>.txt`; both kinds may be supplied together. The reader results go to the partial checker, and a type output is required. These fixtures currently handle only sources without Ford imports, not Jibb module fixtures.
102+- optionally, `imports.txt` selects Hoon `/sur` molds, one `module mold` pair per line. Each module's source goes in `sur/<module>.txt` and is compiled against zuse by both runners. `marks.txt` selects marks, one name per line, with source in `mar/<name>.txt`; both kinds may be supplied together. The reader results go to the partial checker, and a type output is required. Both runners reconstruct fixture text from `%txt` lines and identify the fixture if its compilation crashes; a crash fails the case without discarding its successful parse output. These fixtures currently handle only sources without Ford imports, not Jibb module fixtures.
103+
104+A zero-byte mark fixture currently fails ship synchronization validation after commit. Use a newline-only fixture to test an empty Hoon source on the ship.
103
105
104Names say what a case is for:
106Names say what a case is for:
105
107
docs/prelude-inventory.md+20−1
@@ -20,6 +20,25 @@ Hoon `+$` arms are marked **mold** below; `++` arms can be gates, doors or mold
20
20
21`biff`, `bind`, `bond`, `both`, `clap`, `clef`, `drop`, `fall`, `flit`, `hunt`, `lift`, `mate`, `need`, `some`.
21`biff`, `bind`, `bond`, `both`, `clap`, `clef`, `drop`, `fall`, `flit`, `hunt`, `lift`, `mate`, `need`, `some`.
22
22
23+The following is an audit of the Hoon 135 bodies, not a completed Jibb interface. The current Jibb implementations have only been parsed; the checker and backend do not yet validate or run them.
24+
25+| Name | Hoon behavior | Jibb status |
26+| --- | --- | --- |
27+| `biff` | Applies a gate returning a unit to a present value; absent stays absent. | Written |
28+| `bind` | Applies a gate to a present value and wraps the result; absent stays absent. | Written |
29+| `bond` | Calls a fallback trap for an absent unit, otherwise returns its value. | Missing |
30+| `both` | Returns a unit of both values when both units are present. | Missing |
31+| `clap` | Returns the present unit if only one is present; combines both values with a gate if both are present. | Missing |
32+| `clef` | Applies a gate returning a unit when both inputs are present; otherwise returns an absent unit. | Missing |
33+| `drop` | Converts an absent unit to an empty list and a present unit to a singleton. | Written |
34+| `fall` | Returns the value of a present unit or the supplied fallback. | Written |
35+| `flit` | Returns a gate that wraps a value only if it satisfies the predicate. | Missing |
36+| `hunt` | Returns the only present unit or chooses between two present values with an ordering gate. | Missing |
37+| `lift` | Takes a mold and a unit, then applies the mold to a present value as `bind` does. | Missing; Jibb molds are not callable values |
38+| `mate` | Returns the present unit if only one is present; when both are present it returns one if their values are equal and crashes otherwise. | Missing |
39+| `need` | Extracts a present value and crashes on an absent unit. | Written |
40+| `some` | Wraps a value in a present unit. | Written |
41+
23## 2b
42## 2b
24
43
25`snoc`, `lure`, `fand`, `find`, `flop`, `gulf`, `homo`, `join`, `bake`, `lent`, `levy`, `lien`, `limo`, `murn`, `oust`, `reap`, `rear`, `reel`, `roll`, `scag`, `skid`, `skim`, `skip`, `slag`, `snag`, `snip`, `sort`, `spin`, `spun`, `swag`, `turn`, `weld`, `snap`, `into`, `welp`, `zing`.
44`snoc`, `lure`, `fand`, `find`, `flop`, `gulf`, `homo`, `join`, `bake`, `lent`, `levy`, `lien`, `limo`, `murn`, `oust`, `reap`, `rear`, `reel`, `roll`, `scag`, `skid`, `skim`, `skip`, `slag`, `snag`, `snip`, `sort`, `spin`, `spun`, `swag`, `turn`, `weld`, `snap`, `into`, `welp`, `zing`.
@@ -90,7 +109,7 @@ Hoon 135's `3g` section has exactly 12 exports: ten `+$` molds (`coin`, `dime`,
90
109
91| Hoon name | Source shape and Jibb audit |
110| Hoon name | Source shape and Jibb audit |
92| --- | --- |
111| --- | --- |
93−| `coin` | A union of `[%$ p=dime]`, `[%blob p=*]`, and `[%many p=(list coin)]`. Its `$~` default is dropped: Jibb molds have no default. @iko approved `%$` as a Jibb term literal and pattern on 2026-10-30; the parser implements it and ship verification is pending. Its `%$` case uses the `dime` mold below. |
112+| `coin` | A union of `[%$ p=dime]`, `[%blob p=*]`, and `[%many p=(list coin)]`. Its `$~` default is dropped: Jibb molds have no default. @iko approved `%$` as a Jibb term literal and pattern on 2026-10-30; the parser implements it and its golden cases pass under eval and on the ship. Its `%$` case uses the `dime` mold below. |
94| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
113| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
95| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
114| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
96| `hair` | `[p=@ud q=@ud]`: a parsing position. |
115| `hair` | `[p=@ud q=@ud]`: a parsing position. |
docs/status.md+8−7
@@ -19,7 +19,7 @@ On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's case
19
19
20## Milestone 2: in progress
20## Milestone 2: in progress
21
21
22−The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; partial bridges pass selected Hoon atoms and unfaced cells from `/sur` molds and marks into inference. The reader handles nonrecursive mark samples, named recursion without Ford imports, nested collections, direct ordered maps, certain ordered-map fields, and direct `$^` unions whose cases can be proved disjoint. Recursive mark samples and recursive molds in Ford-importing subjects fail closed until their origin is tracked. Nested `$^`, other nested ordered maps, general union disjointness and complete import integration remain unfinished. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, and generalized atom constraints arising from explicit capitals or bare sample binders, including aliases; other constraint cases and defaulting still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; its golden fixtures include three real Tlon files. The prelude currently has only a few functions, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
22+The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; partial bridges pass selected Hoon atoms and unfaced cells from `/sur` molds and marks into inference. The reader handles nonrecursive mark samples, named recursion without Ford imports, nested collections, direct ordered maps, certain ordered-map fields, and direct `$^` unions whose cases can be proved disjoint. Recursive mark samples and recursive molds in Ford-importing subjects fail closed until their origin is tracked. Nested `$^`, other nested ordered maps, general union disjointness and complete import integration remain unfinished. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, and generalized atom constraints arising from explicit capitals or bare sample binders, including aliases. Unfixed decimal literals default to `@ud` in gate-free inferred types; other constraint cases and defaulting inside gate types still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; its golden fixtures include three real Tlon files. The prelude currently has only a few functions, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
23
23
24## Milestone 1: parser and mark
24## Milestone 1: parser and mark
25
25
@@ -37,9 +37,9 @@ What the plan asks for, and where it is:
37
37
38Besides the plan's list:
38Besides the plan's list:
39
39
40−- 410 golden cases: 194 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
40+- 412 golden cases: 196 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
41−- The 410-case corpus passed under `urbit eval` in 20.5 s. The fake ship passed all 414 tests, including the importer, importer/checker and mark/checker bridges, and unification checks, with 17.9 s for sync and 15.5 s for tests. The importer golden compares 68 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, reads selected molds and marks, and passes Clay-built types through the Clay-built importer and partial checker.
41+- The 412-case corpus passed under `urbit eval` in 21.8 s. The fake ship passed all 416 tests, including the importer, importer/checker and mark/checker bridges, and unification checks, with 19.1 s for sync and 22.5 s for tests. The importer golden compares 74 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, reads selected molds and marks, and passes Clay-built types through the Clay-built importer and partial checker.
42−- `tools/testdata/selftest` (19 checks) and `tools/testdata/ship-selftest` test the tools themselves.
42+- `tools/testdata/selftest` (20 checks) and `tools/testdata/ship-selftest` test the tools themselves.
43- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
43- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
44- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
44- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
45
45
@@ -60,14 +60,15 @@ Besides the plan's list:
60| 26554ac | 2026-10-30 | Infer an atom constraint, extend the prelude and read example molds through Clay |
60| 26554ac | 2026-10-30 | Infer an atom constraint, extend the prelude and read example molds through Clay |
61| fbeaa83 | 2026-10-30 | Extend atom constraints and nested ordered-map imports; connect Clay types to partial inference |
61| fbeaa83 | 2026-10-30 | Extend atom constraints and nested ordered-map imports; connect Clay types to partial inference |
62| 47a1f49 | 2026-10-30 | Read validated Ford imports, widen aura families, and show both sites of selected errors |
62| 47a1f49 | 2026-10-30 | Read validated Ford imports, widen aura families, and show both sites of selected errors |
63−| This change | 2026-10-30 | Read mark samples and test partial mark imports; reject unproven nested `$^`; preserve atom constraints through aliases |
63+| bd37989 | 2026-10-30 | Read mark samples and test partial mark imports; reject unproven nested `$^`; preserve atom constraints through aliases |
64+| This change | 2026-10-30 | Default gate-free decimal types, validate named Hoon mold lookup, and isolate fixture failures |
64
65
65## Checking it
66## Checking it
66
67
67On a machine set up as [development.md](development.md) says:
68On a machine set up as [development.md](development.md) says:
68
69
69```
70```
70−tools/golden # 410 cases under urbit eval
71+tools/golden # 412 cases under urbit eval
71tools/importer-test # the Hoon importer fixture projection
72tools/importer-test # the Hoon importer fixture projection
72tools/type-import-test # the importer/checker bridge fixture
73tools/type-import-test # the importer/checker bridge fixture
73tools/type-mark-test # the mark/checker bridge fixture
74tools/type-mark-test # the mark/checker bridge fixture
@@ -76,7 +77,7 @@ tools/testdata/selftest # the tools themselves
76tools/doc-blocks docs/spec # the doc's examples are golden cases
77tools/doc-blocks docs/spec # the doc's examples are golden cases
77tools/ship start
78tools/ship start
78tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
79tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
79−tools/ship test # the same 410 cases as -test arms on the ship
80+tools/ship test # the same 412 cases as -test arms on the ship
80tools/testdata/ship-selftest
81tools/testdata/ship-selftest
81tools/ship check-commit # |commit stores .jibb files
82tools/ship check-commit # |commit stores .jibb files
82tools/clay-fixtures # example /sur files and marks build through Clay
83tools/clay-fixtures # example /sur files and marks build through Clay
jibb-dev/lib/jibb-import.hoon+33
@@ -74,6 +74,9 @@
74 ?. ?=([%core *] cor) [%| 'Hoon module provenance is unavailable']
74 ?. ?=([%core *] cor) [%| 'Hoon module provenance is unavailable']
75 ?: =(cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
75 ?: =(cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
76 ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
76 ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
77+ =/ chapters=(map term tome) q.r.q.cor
78+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
79+ [%| (crip "Hoon mold `{(trip name)}` is not declared")]
77 ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
80 ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
78 [%| 'Hoon module provenance does not match the selected mold']
81 [%| 'Hoon module provenance does not match the selected mold']
79 =/ result (read-with module name typ [~ cor])
82 =/ result (read-with module name typ [~ cor])
@@ -82,6 +85,30 @@
82 [%| 'a recursive Hoon mold with Ford imports needs source-aware import']
85 [%| 'a recursive Hoon mold with Ford imports needs source-aware import']
83 result
86 result
84::
87::
88+:: +read-named is the source-aware entry point for callers that have
89+:: not selected a Hoon type yet. Check the core and the local arm
90+:: before invoking Hoon's type engine, which otherwise crashes when
91+:: the requested name is absent.
92+++ read-named
93+ |= [module=term name=term cor=type]
94+ ^- (each imported @t)
95+ ?. ?=([%core *] cor) [%| 'Hoon module provenance is unavailable']
96+ ?: =(cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
97+ ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
98+ =/ chapters=(map term tome) q.r.q.cor
99+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
100+ [%| (crip "Hoon mold `{(trip name)}` is not declared")]
101+ =/ attempted=(each type tang)
102+ (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
103+ ?- attempted
104+ [%& *] (read-mold-in module name p.attempted cor)
105+ [%| *]
106+ =/ lines=wall (zing (turn (flop p.attempted) |=(a=tank (wash [0 80] a))))
107+ =/ rev=wall (flop lines)
108+ ?~ rev [%| (crip "Hoon mold `{(trip name)}` could not be evaluated")]
109+ [%| (crip "Hoon mold `{(trip name)}` could not be evaluated: {i.rev}")]
110+ ==
111+::
85:: A mark door's payload is [sample build-subject]. Its outer sample
112:: A mark door's payload is [sample build-subject]. Its outer sample
86:: face names the door sample, not the imported mark type. Collection
113:: face names the door sample, not the imported mark type. Collection
87:: lookup for the sample happened against the pre-door build subject.
114:: lookup for the sample happened against the pre-door build subject.
@@ -956,6 +983,12 @@
956 (crip "shadow-jar: {(show-result (shad %aa))}")
983 (crip "shadow-jar: {(show-result (shad %aa))}")
957 (crip "shadow-jug: {(show-result (shad %bb))}")
984 (crip "shadow-jug: {(show-result (shad %bb))}")
958 (crip "no-provenance: {(show-result (read-mold %small %jar-test (~(play ut sc) (ream '*jar-test'))))}")
985 (crip "no-provenance: {(show-result (read-mold %small %jar-test (~(play ut sc) (ream '*jar-test'))))}")
986+ (crip "named-not-mold: {(show-result (read-named %small %not-mold sc))}")
987+ (crip "named-present: {(show-result (read-named %small %items sc))}")
988+ (crip "named-missing: {(show-result (read-named %small %missing sc))}")
989+ (crip "named-invalid-core: {(show-result (read-named %small %items [%atom %ud ~]))}")
990+ (crip "named-ford-recursive: {(show-result (read-named %ford %recursive fc))}")
991+ (crip "missing-arm: {(show-result (read-mold-in %small %missing [%atom %ud ~] sc))}")
959 (crip "wrong-provenance: {(show-result (read-mold-in %small %action (~(play ut sc) (ream '*items')) sc))}")
992 (crip "wrong-provenance: {(show-result (read-mold-in %small %action (~(play ut sc) (ream '*items')) sc))}")
960 (crip "unverified-subject: {(show-result (read-mold-in %std %jar (~(play ut -:!>(..zuse)) (ream '*(jar @ud @t)')) -:!>(..zuse)))}")
993 (crip "unverified-subject: {(show-result (read-mold-in %std %jar (~(play ut -:!>(..zuse)) (ream '*(jar @ud @t)')) -:!>(..zuse)))}")
961 (crip "presence-topic: {(show-result (present %topic))}")
994 (crip "presence-topic: {(show-result (present %topic))}")
jibb-dev/lib/jibb.hoon+31−2
@@ -4891,6 +4891,35 @@
4891 [%cell $(t hed.t) $(t tal.t)]
4891 [%cell $(t hed.t) $(t tal.t)]
4892 t
4892 t
4893::
4893::
4894+::
4895+:: Default decimal variables only in types with no gates. A gate can
4896+:: generalize an aura from its sample, which requires constraint analysis
4897+:: beyond this fragment; leave those cases unresolved.
4898+::
4899+++ itype-has-gate
4900+ |= t=itype
4901+ ^- ?
4902+ ?- -.t
4903+ %fn &
4904+ %cell |($(t hed.t) $(t tal.t))
4905+ %var |
4906+ %avar |
4907+ %nvar |
4908+ %atom |
4909+ %any-atom |
4910+ %flag |
4911+ ==
4912+::
4913+++ default-decimals
4914+ |= t=itype
4915+ ^- itype
4916+ ?: (itype-has-gate t) t
4917+ ?- -.t
4918+ %nvar [%atom %ud]
4919+ %cell [%cell $(t hed.t) $(t tal.t)]
4920+ * t
4921+ ==
4922+::
4894++ itype-vars
4923++ itype-vars
4895 |= t=itype
4924 |= t=itype
4896 ^- (list @ud)
4925 ^- (list @ud)
@@ -5471,7 +5500,7 @@
5471 =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs mark-externals marks ~ |])
5500 =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs mark-externals marks ~ |])
5472 ?: ?=(%| -.result) $(ds t.ds)
5501 ?: ?=(%| -.result) $(ds t.ds)
5473 ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
5502 ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
5474− =/ typ=itype (itype-normalize typ.p.result sub.state.p.result)
5503+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
5475 ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
5504 ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
5476 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
5505 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
5477 ?: (gth (lent vars) 26) $(ds t.ds)
5506 ?: (gth (lent vars) 26) $(ds t.ds)
@@ -5698,7 +5727,7 @@
5698 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
5727 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
5699 ?: (constrained-capitals caps.state.p.result sub.state.p.result)
5728 ?: (constrained-capitals caps.state.p.result sub.state.p.result)
5700 $(ds t.ds, lines [(crip "++ {(trip name.d)}: explicit capital constraints are not supported by partial inference") lines])
5729 $(ds t.ds, lines [(crip "++ {(trip name.d)}: explicit capital constraints are not supported by partial inference") lines])
5701− =/ typ=itype (itype-normalize typ.p.result sub.state.p.result)
5730+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
5702 ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result)
5731 ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result)
5703 $(ds t.ds, lines [(crip "++ {(trip name.d)}: unresolved aura-variable inference") lines])
5732 $(ds t.ds, lines [(crip "++ {(trip name.d)}: unresolved aura-variable inference") lines])
5704 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
5733 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
tests/golden/types-import-missing-mold/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/- todo` imports molds from a Hoon `/sur` file; unsupported imports are errors where used.
2+tests: The selected `/sur` fixture has no `missing` mold. The reader reports the missing name without crashing the golden runner; partial inference does not claim to check the value.
3+expect: parses
4+expect-types: partial inference reports the imported mold as unsupported
tests/golden/types-import-missing-mold/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture missing
tests/golden/types-import-missing-mold/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/- fixture
2+++ identity |= x=missing.fixture x
tests/golden/types-import-missing-mold/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ title @t
3+--
tests/golden/types-import-missing-mold/tokens.txtnew file+11
@@ -0,0 +1,11 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph ++
5+2:4 name identity
6+2:13 glyph |=
7+2:16 name x
8+2:17 tight glyph =
9+2:18 tight wing missing.fixture
10+2:34 name x
11+2:35 NEWLINE
tests/golden/types-import-missing-mold/tree.txtnew file+6
@@ -0,0 +1,6 @@
1+(module
2+ (sur 1:1 fixture)
3+ (value 2:1 identity
4+ (gate 2:13
5+ (face 2:16 x (ref 2:18 missing.fixture))
6+ (wing 2:34 x))))
tests/golden/types-import-missing-mold/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ identity: sample mold is not supported by partial inference
tests/golden/types-partial-atom-alias/types.txt+1−1
@@ -11,7 +11,7 @@ partial inference; module not checked
11/tests/golden/types-partial-atom-alias/source.jibb:8:15: argument has type [@p @t]
11/tests/golden/types-partial-atom-alias/source.jibb:8:15: argument has type [@p @t]
12++ bad (alias [~zod "hi"])
12++ bad (alias [~zod "hi"])
13 ^
13 ^
14−++ number: unresolved aura-variable inference
14+++ number: @ud
15++ relay: cast mold and expression type do not unify
15++ relay: cast mold and expression type do not unify
16/tests/golden/types-partial-atom-alias/source.jibb:10:13: cast mold has type ?
16/tests/golden/types-partial-atom-alias/source.jibb:10:13: cast mold has type ?
17++ relay ^- ? (alias 7)
17++ relay ^- ? (alias 7)
tests/golden/types-partial-aura/about.txt+1−1
@@ -1,4 +1,4 @@
1source: Grammar tab, Molds: "every expression has a principal type, and there is no general subtyping".
1source: Grammar tab, Molds: "every expression has a principal type, and there is no general subtyping".
2−tests: partial inference: an open numeric aura, an aura fixed by a cast, and an incompatible cast.
2+tests: partial inference: a defaulted decimal aura, an aura fixed by a cast, and an incompatible cast.
3expect: parses
3expect: parses
4expect-types: a partial inference report, not a checked module
4expect-types: a partial inference report, not a checked module
tests/golden/types-partial-aura/types.txt+1−1
@@ -1,5 +1,5 @@
1partial inference; module not checked
1partial inference; module not checked
2−++ n: unresolved aura-variable inference
2+++ n: @ud
3++ good: @ux
3++ good: @ux
4++ bad: cast mold and expression type do not unify
4++ bad: cast mold and expression type do not unify
5/tests/golden/types-partial-aura/source.jibb:3:11: cast mold has type ?
5/tests/golden/types-partial-aura/source.jibb:3:11: cast mold has type ?
tests/golden/types-partial-decimal-default/about.txtnew file+7
@@ -0,0 +1,7 @@
1+Grammar, Literals by context: "A number takes `@ud` only if nothing fixes
2+its aura and its `++` isn't generic over it". Partial inference defaults
3+numbers when the complete inferred type is gate-free, including tuple
4+positions and a polymorphic identity call. A later definition sees the
5+defaulted dependency. Gate types remain unsupported until the checker can
6+establish which aura variables are generalized. This report does not claim
7+that the module has been checked.
tests/golden/types-partial-decimal-default/source.jibbnew file+6
@@ -0,0 +1,6 @@
1+++ later count
2+++ count 7
3+++ pair [1 2]
4+++ id |= x x
5+++ applied (id 5)
6+++ gate |= x 9
tests/golden/types-partial-decimal-default/tokens.txtnew file+34
@@ -0,0 +1,34 @@
1+1:1 glyph ++
2+1:4 name later
3+1:10 name count
4+2:1 NEWLINE
5+2:1 glyph ++
6+2:4 name count
7+2:10 lit 7
8+3:1 NEWLINE
9+3:1 glyph ++
10+3:4 name pair
11+3:9 glyph [
12+3:10 tight lit 1
13+3:12 lit 2
14+3:13 tight glyph ]
15+4:1 NEWLINE
16+4:1 glyph ++
17+4:4 name id
18+4:7 glyph |=
19+4:10 name x
20+4:12 name x
21+5:1 NEWLINE
22+5:1 glyph ++
23+5:4 name applied
24+5:12 glyph (
25+5:13 tight name id
26+5:16 lit 5
27+5:17 tight glyph )
28+6:1 NEWLINE
29+6:1 glyph ++
30+6:4 name gate
31+6:9 glyph |=
32+6:12 name x
33+6:14 lit 9
34+6:15 NEWLINE
tests/golden/types-partial-decimal-default/tree.txtnew file+12
@@ -0,0 +1,12 @@
1+(module
2+ (value 1:1 later (wing 1:10 count))
3+ (value 2:1 count (lit 2:10 7))
4+ (value 3:1 pair
5+ (tuple 3:9 (lit 3:10 1) (lit 3:12 2)))
6+ (value 4:1 id
7+ (gate 4:7 (bind 4:10 x) (wing 4:12 x)))
8+ (value 5:1 applied
9+ (group 5:12
10+ (call 5:13 (wing 5:13 id) (lit 5:16 5))))
11+ (value 6:1 gate
12+ (gate 6:9 (bind 6:12 x) (lit 6:14 9))))
tests/golden/types-partial-decimal-default/types.txtnew file+7
@@ -0,0 +1,7 @@
1+partial inference; module not checked
2+++ later: @ud
3+++ count: @ud
4+++ pair: [@ud @ud]
5+++ id: $-(A A)
6+++ applied: @ud
7+++ gate: unresolved aura-variable inference
tests/importer/about.txt+2−1
@@ -5,7 +5,8 @@ list shadow alongside a nested ordered map is rejected. Static sibling
5collections and dependent sibling molds are tested separately. Nested `$^`
5collections and dependent sibling molds are tested separately. Nested `$^`
6cases fail closed, while nested `$@` cases remain supported. `ford.txt`
6cases fail closed, while nested `$@` cases remain supported. `ford.txt`
7checks a synthetic imported subject and selected mold; other cases check
7checks a synthetic imported subject and selected mold; other cases check
8+transitive imports, named mold lookup, missing names, shadowing, malformed
8−transitive imports, shadowing, malformed subjects and recursion whose
9+subjects and recursion whose
9origin cannot yet be established. The mark fixtures check door samples,
10origin cannot yet be established. The mark fixtures check door samples,
10collection provenance, unsupported gates and recursive sample rejection.
11collection provenance, unsupported gates and recursive sample rejection.
11The synthetic hold in +bad-branch-fixture checks that a failed Hoon branch expansion returns
12The synthetic hold in +bad-branch-fixture checks that a failed Hoon branch expansion returns
tests/importer/small.txt+1
@@ -1,4 +1,5 @@
1|%
1|%
2+++ not-mold 42
2+$ action $%([%add text=@t] [%remove id=@ud])
3+$ action $%([%add text=@t] [%remove id=@ud])
3+$ item [id=@ud text=@t]
4+$ item [id=@ud text=@t]
4+$ optional $@(@ud [name=@t stamp=@ud])
5+$ optional $@(@ud [name=@t stamp=@ud])
tests/importer/tree.txt+6
@@ -57,6 +57,12 @@ shadow-mop: error: Hoon collection provenance is unavailable or shadowed
57shadow-jar: error: Hoon collection provenance is unavailable or shadowed
57shadow-jar: error: Hoon collection provenance is unavailable or shadowed
58shadow-jug: error: Hoon collection provenance is unavailable or shadowed
58shadow-jug: error: Hoon collection provenance is unavailable or shadowed
59no-provenance: error: Hoon collection provenance is unavailable or shadowed
59no-provenance: error: Hoon collection provenance is unavailable or shadowed
60+named-not-mold: error: Hoon mold `not-mold` could not be evaluated: -find.$
61+named-present: (map @ud [id=@ud text=@t])
62+named-missing: error: Hoon mold `missing` is not declared
63+named-invalid-core: error: Hoon module provenance is unavailable
64+named-ford-recursive: error: a recursive Hoon mold with Ford imports needs source-aware import
65+missing-arm: error: Hoon mold `missing` is not declared
60wrong-provenance: error: Hoon module provenance does not match the selected mold
66wrong-provenance: error: Hoon module provenance does not match the selected mold
61unverified-subject: error: Hoon module provenance is unavailable
67unverified-subject: error: Hoon module provenance is unavailable
62presence-topic: (union other typing computing)
68presence-topic: (union other typing computing)
tests/lib/jibb.hoon+186−157
@@ -1174,124 +1174,133 @@
1174/* typ-381 %txt /tests/golden/types-import-mark/types/txt
1174/* typ-381 %txt /tests/golden/types-import-mark/types/txt
1175/* imp-381-1 %txt /tests/golden/types-import-mark/sur/fixture/txt
1175/* imp-381-1 %txt /tests/golden/types-import-mark/sur/fixture/txt
1176/* mark-381-1 %txt /tests/golden/types-import-mark/mar/label/txt
1176/* mark-381-1 %txt /tests/golden/types-import-mark/mar/label/txt
1177−/* src-382 %jibb /tests/golden/types-import-sur/source/jibb
1177+/* src-382 %jibb /tests/golden/types-import-missing-mold/source/jibb
1178+/* tok-382 %txt /tests/golden/types-import-missing-mold/tokens/txt
1179+/* tre-382 %txt /tests/golden/types-import-missing-mold/tree/txt
1180+/* typ-382 %txt /tests/golden/types-import-missing-mold/types/txt
1181+/* imp-382-1 %txt /tests/golden/types-import-missing-mold/sur/fixture/txt
1182+/* src-383 %jibb /tests/golden/types-import-sur/source/jibb
1178−/* tok-382 %txt /tests/golden/types-import-sur/tokens/txt
1183+/* tok-383 %txt /tests/golden/types-import-sur/tokens/txt
1179−/* tre-382 %txt /tests/golden/types-import-sur/tree/txt
1184+/* tre-383 %txt /tests/golden/types-import-sur/tree/txt
1180−/* typ-382 %txt /tests/golden/types-import-sur/types/txt
1185+/* typ-383 %txt /tests/golden/types-import-sur/types/txt
1181−/* imp-382-1 %txt /tests/golden/types-import-sur/sur/fixture/txt
1186+/* imp-383-1 %txt /tests/golden/types-import-sur/sur/fixture/txt
1182−/* imp-382-2 %txt /tests/golden/types-import-sur/sur/fixture/txt
1187+/* imp-383-2 %txt /tests/golden/types-import-sur/sur/fixture/txt
1183−/* src-383 %jibb /tests/golden/types-partial-apply/source/jibb
1188+/* src-384 %jibb /tests/golden/types-partial-apply/source/jibb
1184−/* tok-383 %txt /tests/golden/types-partial-apply/tokens/txt
1189+/* tok-384 %txt /tests/golden/types-partial-apply/tokens/txt
1185−/* tre-383 %txt /tests/golden/types-partial-apply/tree/txt
1190+/* tre-384 %txt /tests/golden/types-partial-apply/tree/txt
1186−/* typ-383 %txt /tests/golden/types-partial-apply/types/txt
1191+/* typ-384 %txt /tests/golden/types-partial-apply/types/txt
1187−/* src-384 %jibb /tests/golden/types-partial-atom-alias/source/jibb
1192+/* src-385 %jibb /tests/golden/types-partial-atom-alias/source/jibb
1188−/* tok-384 %txt /tests/golden/types-partial-atom-alias/tokens/txt
1193+/* tok-385 %txt /tests/golden/types-partial-atom-alias/tokens/txt
1189−/* tre-384 %txt /tests/golden/types-partial-atom-alias/tree/txt
1194+/* tre-385 %txt /tests/golden/types-partial-atom-alias/tree/txt
1190−/* typ-384 %txt /tests/golden/types-partial-atom-alias/types/txt
1195+/* typ-385 %txt /tests/golden/types-partial-atom-alias/types/txt
1191−/* src-385 %jibb /tests/golden/types-partial-atom-constraint/source/jibb
1196+/* src-386 %jibb /tests/golden/types-partial-atom-constraint/source/jibb
1192−/* tok-385 %txt /tests/golden/types-partial-atom-constraint/tokens/txt
1197+/* tok-386 %txt /tests/golden/types-partial-atom-constraint/tokens/txt
1193−/* tre-385 %txt /tests/golden/types-partial-atom-constraint/tree/txt
1198+/* tre-386 %txt /tests/golden/types-partial-atom-constraint/tree/txt
1194−/* typ-385 %txt /tests/golden/types-partial-atom-constraint/types/txt
1199+/* typ-386 %txt /tests/golden/types-partial-atom-constraint/types/txt
1195−/* src-386 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1200+/* src-387 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1196−/* tok-386 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1201+/* tok-387 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1197−/* tre-386 %txt /tests/golden/types-partial-atom-widening/tree/txt
1202+/* tre-387 %txt /tests/golden/types-partial-atom-widening/tree/txt
1198−/* typ-386 %txt /tests/golden/types-partial-atom-widening/types/txt
1203+/* typ-387 %txt /tests/golden/types-partial-atom-widening/types/txt
1199−/* src-387 %jibb /tests/golden/types-partial-aura/source/jibb
1204+/* src-388 %jibb /tests/golden/types-partial-aura/source/jibb
1200−/* tok-387 %txt /tests/golden/types-partial-aura/tokens/txt
1205+/* tok-388 %txt /tests/golden/types-partial-aura/tokens/txt
1201−/* tre-387 %txt /tests/golden/types-partial-aura/tree/txt
1206+/* tre-388 %txt /tests/golden/types-partial-aura/tree/txt
1202−/* typ-387 %txt /tests/golden/types-partial-aura/types/txt
1207+/* typ-388 %txt /tests/golden/types-partial-aura/types/txt
1203−/* src-388 %jibb /tests/golden/types-partial-aura-family/source/jibb
1208+/* src-389 %jibb /tests/golden/types-partial-aura-family/source/jibb
1204−/* tok-388 %txt /tests/golden/types-partial-aura-family/tokens/txt
1209+/* tok-389 %txt /tests/golden/types-partial-aura-family/tokens/txt
1205−/* tre-388 %txt /tests/golden/types-partial-aura-family/tree/txt
1210+/* tre-389 %txt /tests/golden/types-partial-aura-family/tree/txt
1206−/* typ-388 %txt /tests/golden/types-partial-aura-family/types/txt
1211+/* typ-389 %txt /tests/golden/types-partial-aura-family/types/txt
1207−/* src-389 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1212+/* src-390 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1208−/* tok-389 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1213+/* tok-390 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1209−/* tre-389 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1214+/* tre-390 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1210−/* typ-389 %txt /tests/golden/types-partial-aura-generalization/types/txt
1215+/* typ-390 %txt /tests/golden/types-partial-aura-generalization/types/txt
1211−/* src-390 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1216+/* src-391 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1212−/* tok-390 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1217+/* tok-391 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1213−/* tre-390 %txt /tests/golden/types-partial-bare-atom/tree/txt
1218+/* tre-391 %txt /tests/golden/types-partial-bare-atom/tree/txt
1214−/* typ-390 %txt /tests/golden/types-partial-bare-atom/types/txt
1219+/* typ-391 %txt /tests/golden/types-partial-bare-atom/types/txt
1215−/* src-391 %jibb /tests/golden/types-partial-branch-widening/source/jibb
1220+/* src-392 %jibb /tests/golden/types-partial-branch-widening/source/jibb
1216−/* tok-391 %txt /tests/golden/types-partial-branch-widening/tokens/txt
1221+/* tok-392 %txt /tests/golden/types-partial-branch-widening/tokens/txt
1217−/* tre-391 %txt /tests/golden/types-partial-branch-widening/tree/txt
1222+/* tre-392 %txt /tests/golden/types-partial-branch-widening/tree/txt
1218−/* typ-391 %txt /tests/golden/types-partial-branch-widening/types/txt
1223+/* typ-392 %txt /tests/golden/types-partial-branch-widening/types/txt
1219−/* src-392 %jibb /tests/golden/types-partial-conflicting-sites/source/jibb
1224+/* src-393 %jibb /tests/golden/types-partial-conflicting-sites/source/jibb
1220−/* tok-392 %txt /tests/golden/types-partial-conflicting-sites/tokens/txt
1225+/* tok-393 %txt /tests/golden/types-partial-conflicting-sites/tokens/txt
1221−/* tre-392 %txt /tests/golden/types-partial-conflicting-sites/tree/txt
1226+/* tre-393 %txt /tests/golden/types-partial-conflicting-sites/tree/txt
1222−/* typ-392 %txt /tests/golden/types-partial-conflicting-sites/types/txt
1227+/* typ-393 %txt /tests/golden/types-partial-conflicting-sites/types/txt
1228+/* src-394 %jibb /tests/golden/types-partial-decimal-default/source/jibb
1229+/* tok-394 %txt /tests/golden/types-partial-decimal-default/tokens/txt
1230+/* tre-394 %txt /tests/golden/types-partial-decimal-default/tree/txt
1231+/* typ-394 %txt /tests/golden/types-partial-decimal-default/types/txt
1223−/* src-393 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1232+/* src-395 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1224−/* tok-393 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1233+/* tok-395 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1225−/* tre-393 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1234+/* tre-395 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1226−/* typ-393 %txt /tests/golden/types-partial-dependency-chain/types/txt
1235+/* typ-395 %txt /tests/golden/types-partial-dependency-chain/types/txt
1227−/* src-394 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1236+/* src-396 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1228−/* tok-394 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1237+/* tok-396 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1229−/* tre-394 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1238+/* tre-396 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1230−/* typ-394 %txt /tests/golden/types-partial-explicit-capital/types/txt
1239+/* typ-396 %txt /tests/golden/types-partial-explicit-capital/types/txt
1231−/* src-395 %jibb /tests/golden/types-partial-forward/source/jibb
1240+/* src-397 %jibb /tests/golden/types-partial-forward/source/jibb
1232−/* tok-395 %txt /tests/golden/types-partial-forward/tokens/txt
1241+/* tok-397 %txt /tests/golden/types-partial-forward/tokens/txt
1233−/* tre-395 %txt /tests/golden/types-partial-forward/tree/txt
1242+/* tre-397 %txt /tests/golden/types-partial-forward/tree/txt
1234−/* typ-395 %txt /tests/golden/types-partial-forward/types/txt
1243+/* typ-397 %txt /tests/golden/types-partial-forward/types/txt
1235−/* src-396 %jibb /tests/golden/types-partial-generalization/source/jibb
1244+/* src-398 %jibb /tests/golden/types-partial-generalization/source/jibb
1236−/* tok-396 %txt /tests/golden/types-partial-generalization/tokens/txt
1245+/* tok-398 %txt /tests/golden/types-partial-generalization/tokens/txt
1237−/* tre-396 %txt /tests/golden/types-partial-generalization/tree/txt
1246+/* tre-398 %txt /tests/golden/types-partial-generalization/tree/txt
1238−/* typ-396 %txt /tests/golden/types-partial-generalization/types/txt
1247+/* typ-398 %txt /tests/golden/types-partial-generalization/types/txt
1239−/* src-397 %jibb /tests/golden/types-partial-identity/source/jibb
1248+/* src-399 %jibb /tests/golden/types-partial-identity/source/jibb
1240−/* tok-397 %txt /tests/golden/types-partial-identity/tokens/txt
1249+/* tok-399 %txt /tests/golden/types-partial-identity/tokens/txt
1241−/* tre-397 %txt /tests/golden/types-partial-identity/tree/txt
1250+/* tre-399 %txt /tests/golden/types-partial-identity/tree/txt
1242−/* typ-397 %txt /tests/golden/types-partial-identity/types/txt
1251+/* typ-399 %txt /tests/golden/types-partial-identity/types/txt
1243−/* src-398 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1252+/* src-400 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1244−/* tok-398 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1253+/* tok-400 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1245−/* tre-398 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1254+/* tre-400 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1246−/* typ-398 %txt /tests/golden/types-partial-independent-atoms/types/txt
1255+/* typ-400 %txt /tests/golden/types-partial-independent-atoms/types/txt
1247−/* src-399 %jibb /tests/golden/types-partial-many-atom-constraints/source/jibb
1256+/* src-401 %jibb /tests/golden/types-partial-many-atom-constraints/source/jibb
1248−/* tok-399 %txt /tests/golden/types-partial-many-atom-constraints/tokens/txt
1257+/* tok-401 %txt /tests/golden/types-partial-many-atom-constraints/tokens/txt
1249−/* tre-399 %txt /tests/golden/types-partial-many-atom-constraints/tree/txt
1258+/* tre-401 %txt /tests/golden/types-partial-many-atom-constraints/tree/txt
1250−/* typ-399 %txt /tests/golden/types-partial-many-atom-constraints/types/txt
1259+/* typ-401 %txt /tests/golden/types-partial-many-atom-constraints/types/txt
1251−/* src-400 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1260+/* src-402 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1252−/* tok-400 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1261+/* tok-402 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1253−/* tre-400 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1262+/* tre-402 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1254−/* typ-400 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1263+/* typ-402 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1255−/* src-401 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1264+/* src-403 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1256−/* tok-401 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1265+/* tok-403 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1257−/* tre-401 %txt /tests/golden/types-partial-mold-composite/tree/txt
1266+/* tre-403 %txt /tests/golden/types-partial-mold-composite/tree/txt
1258−/* typ-401 %txt /tests/golden/types-partial-mold-composite/types/txt
1267+/* typ-403 %txt /tests/golden/types-partial-mold-composite/types/txt
1259−/* src-402 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1268+/* src-404 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1260−/* tok-402 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1269+/* tok-404 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1261−/* tre-402 %txt /tests/golden/types-partial-mold-forward/tree/txt
1270+/* tre-404 %txt /tests/golden/types-partial-mold-forward/tree/txt
1262−/* typ-402 %txt /tests/golden/types-partial-mold-forward/types/txt
1271+/* typ-404 %txt /tests/golden/types-partial-mold-forward/types/txt
1263−/* src-403 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1272+/* src-405 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1264−/* tok-403 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1273+/* tok-405 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1265−/* tre-403 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1274+/* tre-405 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1266−/* typ-403 %txt /tests/golden/types-partial-mold-recursive/types/txt
1275+/* typ-405 %txt /tests/golden/types-partial-mold-recursive/types/txt
1267−/* src-404 %jibb /tests/golden/types-partial-occurs/source/jibb
1276+/* src-406 %jibb /tests/golden/types-partial-occurs/source/jibb
1268−/* tok-404 %txt /tests/golden/types-partial-occurs/tokens/txt
1277+/* tok-406 %txt /tests/golden/types-partial-occurs/tokens/txt
1269−/* tre-404 %txt /tests/golden/types-partial-occurs/tree/txt
1278+/* tre-406 %txt /tests/golden/types-partial-occurs/tree/txt
1270−/* typ-404 %txt /tests/golden/types-partial-occurs/types/txt
1279+/* typ-406 %txt /tests/golden/types-partial-occurs/types/txt
1271−/* src-405 %jibb /tests/golden/types-partial-projection/source/jibb
1280+/* src-407 %jibb /tests/golden/types-partial-projection/source/jibb
1272−/* tok-405 %txt /tests/golden/types-partial-projection/tokens/txt
1281+/* tok-407 %txt /tests/golden/types-partial-projection/tokens/txt
1273−/* tre-405 %txt /tests/golden/types-partial-projection/tree/txt
1282+/* tre-407 %txt /tests/golden/types-partial-projection/tree/txt
1274−/* typ-405 %txt /tests/golden/types-partial-projection/types/txt
1283+/* typ-407 %txt /tests/golden/types-partial-projection/types/txt
1275−/* src-406 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1284+/* src-408 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1276−/* tok-406 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1285+/* tok-408 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1277−/* tre-406 %txt /tests/golden/types-partial-shadow-global/tree/txt
1286+/* tre-408 %txt /tests/golden/types-partial-shadow-global/tree/txt
1278−/* typ-406 %txt /tests/golden/types-partial-shadow-global/types/txt
1287+/* typ-408 %txt /tests/golden/types-partial-shadow-global/types/txt
1279−/* src-407 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1288+/* src-409 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1280−/* tok-407 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1289+/* tok-409 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1281−/* tre-407 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1290+/* tre-409 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1282−/* typ-407 %txt /tests/golden/types-partial-shared-tvar/types/txt
1291+/* typ-409 %txt /tests/golden/types-partial-shared-tvar/types/txt
1283−/* src-408 %jibb /tests/golden/types-partial-union-cases/source/jibb
1292+/* src-410 %jibb /tests/golden/types-partial-union-cases/source/jibb
1284−/* tok-408 %txt /tests/golden/types-partial-union-cases/tokens/txt
1293+/* tok-410 %txt /tests/golden/types-partial-union-cases/tokens/txt
1285−/* tre-408 %txt /tests/golden/types-partial-union-cases/tree/txt
1294+/* tre-410 %txt /tests/golden/types-partial-union-cases/tree/txt
1286−/* typ-408 %txt /tests/golden/types-partial-union-cases/types/txt
1295+/* typ-410 %txt /tests/golden/types-partial-union-cases/types/txt
1287−/* src-409 %jibb /tests/golden/types-partial-union-edges/source/jibb
1296+/* src-411 %jibb /tests/golden/types-partial-union-edges/source/jibb
1288−/* tok-409 %txt /tests/golden/types-partial-union-edges/tokens/txt
1297+/* tok-411 %txt /tests/golden/types-partial-union-edges/tokens/txt
1289−/* tre-409 %txt /tests/golden/types-partial-union-edges/tree/txt
1298+/* tre-411 %txt /tests/golden/types-partial-union-edges/tree/txt
1290−/* typ-409 %txt /tests/golden/types-partial-union-edges/types/txt
1299+/* typ-411 %txt /tests/golden/types-partial-union-edges/types/txt
1291−/* src-410 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1300+/* src-412 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1292−/* tok-410 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1301+/* tok-412 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1293−/* tre-410 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1302+/* tre-412 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1294−/* typ-410 %txt /tests/golden/types-partial-unresolved-tag/types/txt
1303+/* typ-412 %txt /tests/golden/types-partial-unresolved-tag/types/txt
1295|%
1304|%
1296:: one arm per case
1305:: one arm per case
1297::
1306::
@@ -2057,64 +2066,68 @@
2057 (weld (check ~.prelude-unit-list-transforms src-380 `tok-380 `tre-380) (check-types ~.prelude-unit-list-transforms ~[%tests %golden ~.prelude-unit-list-transforms %source %jibb] src-380 `typ-380))
2066 (weld (check ~.prelude-unit-list-transforms src-380 `tok-380 `tre-380) (check-types ~.prelude-unit-list-transforms ~[%tests %golden ~.prelude-unit-list-transforms %source %jibb] src-380 `typ-380))
2058++ test-types-import-mark
2067++ test-types-import-mark
2059 (weld (check ~.types-import-mark src-381 `tok-381 `tre-381) (check-mark-types ~.types-import-mark ~[%tests %golden ~.types-import-mark %source %jibb] src-381 `typ-381 ~[[%fixture %title imp-381-1]] ~[[%label mark-381-1]]))
2068 (weld (check ~.types-import-mark src-381 `tok-381 `tre-381) (check-mark-types ~.types-import-mark ~[%tests %golden ~.types-import-mark %source %jibb] src-381 `typ-381 ~[[%fixture %title imp-381-1]] ~[[%label mark-381-1]]))
2069+++ test-types-import-missing-mold
2070+ (weld (check ~.types-import-missing-mold src-382 `tok-382 `tre-382) (check-import-types ~.types-import-missing-mold ~[%tests %golden ~.types-import-missing-mold %source %jibb] src-382 `typ-382 ~[[%fixture %missing imp-382-1]]))
2060++ test-types-import-sur
2071++ test-types-import-sur
2061− (weld (check ~.types-import-sur src-382 `tok-382 `tre-382) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-382 `typ-382 ~[[%fixture %title imp-382-1] [%fixture %pair imp-382-2]]))
2072+ (weld (check ~.types-import-sur src-383 `tok-383 `tre-383) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-383 `typ-383 ~[[%fixture %title imp-383-1] [%fixture %pair imp-383-2]]))
2062++ test-types-partial-apply
2073++ test-types-partial-apply
2063− (weld (check ~.types-partial-apply src-383 `tok-383 `tre-383) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-383 `typ-383))
2074+ (weld (check ~.types-partial-apply src-384 `tok-384 `tre-384) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-384 `typ-384))
2064++ test-types-partial-atom-alias
2075++ test-types-partial-atom-alias
2065− (weld (check ~.types-partial-atom-alias src-384 `tok-384 `tre-384) (check-types ~.types-partial-atom-alias ~[%tests %golden ~.types-partial-atom-alias %source %jibb] src-384 `typ-384))
2076+ (weld (check ~.types-partial-atom-alias src-385 `tok-385 `tre-385) (check-types ~.types-partial-atom-alias ~[%tests %golden ~.types-partial-atom-alias %source %jibb] src-385 `typ-385))
2066++ test-types-partial-atom-constraint
2077++ test-types-partial-atom-constraint
2067− (weld (check ~.types-partial-atom-constraint src-385 `tok-385 `tre-385) (check-types ~.types-partial-atom-constraint ~[%tests %golden ~.types-partial-atom-constraint %source %jibb] src-385 `typ-385))
2078+ (weld (check ~.types-partial-atom-constraint src-386 `tok-386 `tre-386) (check-types ~.types-partial-atom-constraint ~[%tests %golden ~.types-partial-atom-constraint %source %jibb] src-386 `typ-386))
2068++ test-types-partial-atom-widening
2079++ test-types-partial-atom-widening
2069− (weld (check ~.types-partial-atom-widening src-386 `tok-386 `tre-386) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-386 `typ-386))
2080+ (weld (check ~.types-partial-atom-widening src-387 `tok-387 `tre-387) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-387 `typ-387))
2070++ test-types-partial-aura
2081++ test-types-partial-aura
2071− (weld (check ~.types-partial-aura src-387 `tok-387 `tre-387) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-387 `typ-387))
2082+ (weld (check ~.types-partial-aura src-388 `tok-388 `tre-388) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-388 `typ-388))
2072++ test-types-partial-aura-family
2083++ test-types-partial-aura-family
2073− (weld (check ~.types-partial-aura-family src-388 `tok-388 `tre-388) (check-types ~.types-partial-aura-family ~[%tests %golden ~.types-partial-aura-family %source %jibb] src-388 `typ-388))
2084+ (weld (check ~.types-partial-aura-family src-389 `tok-389 `tre-389) (check-types ~.types-partial-aura-family ~[%tests %golden ~.types-partial-aura-family %source %jibb] src-389 `typ-389))
2074++ test-types-partial-aura-generalization
2085++ test-types-partial-aura-generalization
2075− (weld (check ~.types-partial-aura-generalization src-389 `tok-389 `tre-389) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-389 `typ-389))
2086+ (weld (check ~.types-partial-aura-generalization src-390 `tok-390 `tre-390) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-390 `typ-390))
2076++ test-types-partial-bare-atom
2087++ test-types-partial-bare-atom
2077− (weld (check ~.types-partial-bare-atom src-390 `tok-390 `tre-390) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-390 `typ-390))
2088+ (weld (check ~.types-partial-bare-atom src-391 `tok-391 `tre-391) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-391 `typ-391))
2078++ test-types-partial-branch-widening
2089++ test-types-partial-branch-widening
2079− (weld (check ~.types-partial-branch-widening src-391 `tok-391 `tre-391) (check-types ~.types-partial-branch-widening ~[%tests %golden ~.types-partial-branch-widening %source %jibb] src-391 `typ-391))
2090+ (weld (check ~.types-partial-branch-widening src-392 `tok-392 `tre-392) (check-types ~.types-partial-branch-widening ~[%tests %golden ~.types-partial-branch-widening %source %jibb] src-392 `typ-392))
2080++ test-types-partial-conflicting-sites
2091++ test-types-partial-conflicting-sites
2081− (weld (check ~.types-partial-conflicting-sites src-392 `tok-392 `tre-392) (check-types ~.types-partial-conflicting-sites ~[%tests %golden ~.types-partial-conflicting-sites %source %jibb] src-392 `typ-392))
2092+ (weld (check ~.types-partial-conflicting-sites src-393 `tok-393 `tre-393) (check-types ~.types-partial-conflicting-sites ~[%tests %golden ~.types-partial-conflicting-sites %source %jibb] src-393 `typ-393))
2093+++ test-types-partial-decimal-default
2094+ (weld (check ~.types-partial-decimal-default src-394 `tok-394 `tre-394) (check-types ~.types-partial-decimal-default ~[%tests %golden ~.types-partial-decimal-default %source %jibb] src-394 `typ-394))
2082++ test-types-partial-dependency-chain
2095++ test-types-partial-dependency-chain
2083− (weld (check ~.types-partial-dependency-chain src-393 `tok-393 `tre-393) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-393 `typ-393))
2096+ (weld (check ~.types-partial-dependency-chain src-395 `tok-395 `tre-395) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-395 `typ-395))
2084++ test-types-partial-explicit-capital
2097++ test-types-partial-explicit-capital
2085− (weld (check ~.types-partial-explicit-capital src-394 `tok-394 `tre-394) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-394 `typ-394))
2098+ (weld (check ~.types-partial-explicit-capital src-396 `tok-396 `tre-396) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-396 `typ-396))
2086++ test-types-partial-forward
2099++ test-types-partial-forward
2087− (weld (check ~.types-partial-forward src-395 `tok-395 `tre-395) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-395 `typ-395))
2100+ (weld (check ~.types-partial-forward src-397 `tok-397 `tre-397) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-397 `typ-397))
2088++ test-types-partial-generalization
2101++ test-types-partial-generalization
2089− (weld (check ~.types-partial-generalization src-396 `tok-396 `tre-396) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-396 `typ-396))
2102+ (weld (check ~.types-partial-generalization src-398 `tok-398 `tre-398) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-398 `typ-398))
2090++ test-types-partial-identity
2103++ test-types-partial-identity
2091− (weld (check ~.types-partial-identity src-397 `tok-397 `tre-397) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-397 `typ-397))
2104+ (weld (check ~.types-partial-identity src-399 `tok-399 `tre-399) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-399 `typ-399))
2092++ test-types-partial-independent-atoms
2105++ test-types-partial-independent-atoms
2093− (weld (check ~.types-partial-independent-atoms src-398 `tok-398 `tre-398) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-398 `typ-398))
2106+ (weld (check ~.types-partial-independent-atoms src-400 `tok-400 `tre-400) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-400 `typ-400))
2094++ test-types-partial-many-atom-constraints
2107++ test-types-partial-many-atom-constraints
2095− (weld (check ~.types-partial-many-atom-constraints src-399 `tok-399 `tre-399) (check-types ~.types-partial-many-atom-constraints ~[%tests %golden ~.types-partial-many-atom-constraints %source %jibb] src-399 `typ-399))
2108+ (weld (check ~.types-partial-many-atom-constraints src-401 `tok-401 `tre-401) (check-types ~.types-partial-many-atom-constraints ~[%tests %golden ~.types-partial-many-atom-constraints %source %jibb] src-401 `typ-401))
2096++ test-types-partial-mold-bare-aura
2109++ test-types-partial-mold-bare-aura
2097− (weld (check ~.types-partial-mold-bare-aura src-400 `tok-400 `tre-400) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-400 `typ-400))
2110+ (weld (check ~.types-partial-mold-bare-aura src-402 `tok-402 `tre-402) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-402 `typ-402))
2098++ test-types-partial-mold-composite
2111++ test-types-partial-mold-composite
2099− (weld (check ~.types-partial-mold-composite src-401 `tok-401 `tre-401) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-401 `typ-401))
2112+ (weld (check ~.types-partial-mold-composite src-403 `tok-403 `tre-403) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-403 `typ-403))
2100++ test-types-partial-mold-forward
2113++ test-types-partial-mold-forward
2101− (weld (check ~.types-partial-mold-forward src-402 `tok-402 `tre-402) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-402 `typ-402))
2114+ (weld (check ~.types-partial-mold-forward src-404 `tok-404 `tre-404) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-404 `typ-404))
2102++ test-types-partial-mold-recursive
2115++ test-types-partial-mold-recursive
2103− (weld (check ~.types-partial-mold-recursive src-403 `tok-403 `tre-403) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-403 `typ-403))
2116+ (weld (check ~.types-partial-mold-recursive src-405 `tok-405 `tre-405) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-405 `typ-405))
2104++ test-types-partial-occurs
2117++ test-types-partial-occurs
2105− (weld (check ~.types-partial-occurs src-404 `tok-404 `tre-404) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-404 `typ-404))
2118+ (weld (check ~.types-partial-occurs src-406 `tok-406 `tre-406) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-406 `typ-406))
2106++ test-types-partial-projection
2119++ test-types-partial-projection
2107− (weld (check ~.types-partial-projection src-405 `tok-405 `tre-405) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-405 `typ-405))
2120+ (weld (check ~.types-partial-projection src-407 `tok-407 `tre-407) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-407 `typ-407))
2108++ test-types-partial-shadow-global
2121++ test-types-partial-shadow-global
2109− (weld (check ~.types-partial-shadow-global src-406 `tok-406 `tre-406) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-406 `typ-406))
2122+ (weld (check ~.types-partial-shadow-global src-408 `tok-408 `tre-408) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-408 `typ-408))
2110++ test-types-partial-shared-tvar
2123++ test-types-partial-shared-tvar
2111− (weld (check ~.types-partial-shared-tvar src-407 `tok-407 `tre-407) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-407 `typ-407))
2124+ (weld (check ~.types-partial-shared-tvar src-409 `tok-409 `tre-409) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-409 `typ-409))
2112++ test-types-partial-union-cases
2125++ test-types-partial-union-cases
2113− (weld (check ~.types-partial-union-cases src-408 `tok-408 `tre-408) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-408 `typ-408))
2126+ (weld (check ~.types-partial-union-cases src-410 `tok-410 `tre-410) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-410 `typ-410))
2114++ test-types-partial-union-edges
2127++ test-types-partial-union-edges
2115− (weld (check ~.types-partial-union-edges src-409 `tok-409 `tre-409) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-409 `typ-409))
2128+ (weld (check ~.types-partial-union-edges src-411 `tok-411 `tre-411) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-411 `typ-411))
2116++ test-types-partial-unresolved-tag
2129++ test-types-partial-unresolved-tag
2117− (weld (check ~.types-partial-unresolved-tag src-410 `tok-410 `tre-410) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-410 `typ-410))
2130+ (weld (check ~.types-partial-unresolved-tag src-412 `tok-412 `tre-412) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-412 `typ-412))
2118::
2131::
2119:: +check: run golden:jibb on a case and compare both outputs
2132:: +check: run golden:jibb on a case and compare both outputs
2120::
2133::
@@ -2179,34 +2192,50 @@
2179++ check-import-types
2192++ check-import-types
2180 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain])]
2193 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain])]
2181 ^- tang
2194 ^- tang
2182− ?: (lien fixtures |=(f=[module=term mold=term source=wain] ?=(~ source.f)))
2195+ =/ result (mule |.((import-types-result at src fixtures)))
2183− ~[leaf+"an imported Hoon fixture is missing or empty"]
2196+ ?: ?=(%| -.result)
2197+ [leaf+"fixture compilation or type checking crashed" p.result]
2198+ (compare (file case "types.txt") want p.result)
2199+::
2200+++ import-types-result
2201+ |= [at=path src=@t fixtures=(list [module=term mold=term source=wain])]
2202+ ^- @t
2184 =/ external=(list [module=term name=term result=*])
2203 =/ external=(list [module=term name=term result=*])
2185 %+ turn fixtures
2204 %+ turn fixtures
2186 |= fixture=[module=term mold=term source=wain]
2205 |= fixture=[module=term mold=term source=wain]
2206+ ~_ leaf+"/sur/{(trip module.fixture)}.txt fixture"
2207+ ?~ source.fixture !!
2187 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2208 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2188 =/ cor=type -:(ride -:!>(..zuse) text)
2209 =/ cor=type -:(ride -:!>(..zuse) text)
2189− =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
2190− [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
2210+ [module.fixture mold.fixture (read-named:jibb-import module.fixture mold.fixture cor)]
2191− (compare (file case "types.txt") want (golden-types-imports:jibb at src external))
2211+ (golden-types-imports:jibb at src external)
2192::
2212::
2193++ check-mark-types
2213++ check-mark-types
2194 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
2214 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
2195 ^- tang
2215 ^- tang
2196− ?: |((lien fixtures |=(f=[module=term mold=term source=wain] ?=(~ source.f))) (lien marks |=(m=[name=term source=wain] ?=(~ source.m))))
2216+ =/ result (mule |.((mark-types-result at src fixtures marks)))
2197− ~[leaf+"an imported Hoon fixture is missing or empty"]
2217+ ?: ?=(%| -.result)
2218+ [leaf+"fixture compilation or type checking crashed" p.result]
2219+ (compare (file case "types.txt") want p.result)
2220+::
2221+++ mark-types-result
2222+ |= [at=path src=@t fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
2223+ ^- @t
2198 =/ external=(list [module=term name=term result=*])
2224 =/ external=(list [module=term name=term result=*])
2199 %+ turn fixtures
2225 %+ turn fixtures
2200 |= fixture=[module=term mold=term source=wain]
2226 |= fixture=[module=term mold=term source=wain]
2227+ ~_ leaf+"/sur/{(trip module.fixture)}.txt fixture"
2228+ ?~ source.fixture !!
2201 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2229 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2202 =/ cor=type -:(ride -:!>(..zuse) text)
2230 =/ cor=type -:(ride -:!>(..zuse) text)
2203− =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
2204− [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
2231+ [module.fixture mold.fixture (read-named:jibb-import module.fixture mold.fixture cor)]
2205 =/ mark-external=(list [name=term result=*])
2232 =/ mark-external=(list [name=term result=*])
2206 %+ turn marks
2233 %+ turn marks
2207 |= fixture=[name=term source=wain]
2234 |= fixture=[name=term source=wain]
2235+ ~_ leaf+"/mar/{(trip name.fixture)}.txt fixture"
2236+ ?~ source.fixture !!
2208 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2237 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\0a'))))
2209 =/ cor=type -:(ride -:!>(..zuse) text)
2238 =/ cor=type -:(ride -:!>(..zuse) text)
2210 [name.fixture (read-mark:jibb-import name.fixture cor)]
2239 [name.fixture (read-mark:jibb-import name.fixture cor)]
2211− (compare (file case "types.txt") want (golden-types-with-marks:jibb at src external mark-external))
2240+ (golden-types-with-marks:jibb at src external mark-external)
2212--
2241--
tools/golden+30−12
@@ -58,12 +58,15 @@ HARNESS = r""":: The harness tools/golden writes after the library. It runs
58 |= [name=@t metadata=[logical=(unit path) check=? imports=(list [module=term mold=term source=@t]) marks=(list [name=term source=@t])] src=@t]
58 |= [name=@t metadata=[logical=(unit path) check=? imports=(list [module=term mold=term source=@t]) marks=(list [name=term source=@t])] src=@t]
59 ^- @t
59 ^- @t
60 =/ at=path ?~(logical.metadata (file name) u.logical.metadata)
60 =/ at=path ?~(logical.metadata (file name) u.logical.metadata)
61− =/ res (mule |.([(golden:lib at src) {types-expr}]))
61+ =/ parsed (mule |.((golden:lib at src)))
62− ?: ?=(%| -.res)
62+ ?: ?=(%| -.parsed)
63− =/ why=@t (crash p.res)
63+ =/ why=@t (crash p.parsed)
64 (fields ~[name 'crash' why why why])
64 (fields ~[name 'crash' why why why])
65− =/ out=[[tokens=@t tree=@t] types=@t] p.res
65+ =/ out=[tokens=@t tree=@t] p.parsed
66+ =/ typed (mule |.({types-expr}))
67+ ?: ?=(%| -.typed)
68+ (fields ~[name 'types-crash' tokens.out tree.out (crash p.typed)])
66− (fields ~[name 'ok' tokens.out tree.out types.out])
69+ (fields ~[name 'ok' tokens.out tree.out p.typed])
67::
70::
68++ file
71++ file
69 |= name=@
72 |= name=@
@@ -98,17 +101,27 @@ IMPORT_HELPER = r"""
98 ^- (list [module=term name=term result=*])
101 ^- (list [module=term name=term result=*])
99 %+ turn fixtures
102 %+ turn fixtures
100 |= fixture=[module=term mold=term source=@t]
103 |= fixture=[module=term mold=term source=@t]
104+ ~_ leaf+"/sur/{(trip module.fixture)}.txt fixture"
105+ =/ source=@t (fixture-text source.fixture)
106+ ?~ source !!
101− =/ cor=type -:(ride -:!>(..zuse) source.fixture)
107+ =/ cor=type -:(ride -:!>(..zuse) source)
102− =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
103− [module.fixture mold.fixture (read-mold-in:reader module.fixture mold.fixture typ cor)]
108+ [module.fixture mold.fixture (read-named:reader module.fixture mold.fixture cor)]
104::
109::
105++ import-marks
110++ import-marks
106 |= fixtures=(list [name=term source=@t])
111 |= fixtures=(list [name=term source=@t])
107 ^- (list [name=term result=*])
112 ^- (list [name=term result=*])
108 %+ turn fixtures
113 %+ turn fixtures
109 |= fixture=[name=term source=@t]
114 |= fixture=[name=term source=@t]
115+ ~_ leaf+"/mar/{(trip name.fixture)}.txt fixture"
116+ =/ source=@t (fixture-text source.fixture)
117+ ?~ source !!
110− =/ cor=type -:(ride -:!>(..zuse) source.fixture)
118+ =/ cor=type -:(ride -:!>(..zuse) source)
111 [name.fixture (read-mark:reader name.fixture cor)]
119 [name.fixture (read-mark:reader name.fixture cor)]
120+:: Clay's %txt mark supplies lines, with a newline reconstructed per line.
121+++ fixture-text
122+ |= source=@t
123+ ^- @t
124+ (rap 3 (turn (to-wain:format source) |=(line=@t (cat 3 line '\0a'))))
112"""
125"""
113
126
114
127
@@ -136,6 +149,7 @@ class Case:
136 with open(self.source_path, 'rb') as f:
149 with open(self.source_path, 'rb') as f:
137 self.source = f.read()
150 self.source = f.read()
138 self.crashed = False
151 self.crashed = False
152+ self.crash_kind = 'tokens' # the output holding a crash's trace
139 self.crash_at = None # the innermost library spot of a crash
153 self.crash_at = None # the innermost library spot of a crash
140 self.outputs = {} # 'tokens' and 'tree' -> bytes
154 self.outputs = {} # 'tokens' and 'tree' -> bytes
141
155
@@ -251,11 +265,15 @@ def decode(prog, noun, cases):
251 if name != case.name.encode():
265 if name != case.name.encode():
252 raise ue.ToolError('the harness output is out of order at %s'
266 raise ue.ToolError('the harness output is out of order at %s'
253 % case.name)
267 % case.name)
254− case.crashed = status == b'crash'
268+ case.crashed = status in (b'crash', b'types-crash')
255− if case.crashed:
269+ if status == b'crash':
256 tokens, case.crash_at = crash_text(
270 tokens, case.crash_at = crash_text(
257 prog, tokens.decode('utf-8', 'surrogateescape').split('\n'))
271 prog, tokens.decode('utf-8', 'surrogateescape').split('\n'))
258 tree = types = tokens
272 tree = types = tokens
273+ elif status == b'types-crash':
274+ case.crash_kind = 'types'
275+ types, case.crash_at = crash_text(
276+ prog, types.decode('utf-8', 'surrogateescape').split('\n'))
259 case.outputs = {'tokens': tokens, 'tree': tree}
277 case.outputs = {'tokens': tokens, 'tree': tree}
260 if case.want_types:
278 if case.want_types:
261 case.outputs['types'] = types
279 case.outputs['types'] = types
@@ -356,7 +374,7 @@ def compare(case):
356 """PASS or FAIL lines for one case."""
374 """PASS or FAIL lines for one case."""
357 if case.crashed:
375 if case.crashed:
358 out = [colour('31', 'FAIL') + ' %s: crashed' % case.name]
376 out = [colour('31', 'FAIL') + ' %s: crashed' % case.name]
359− out += [' ' + l for l in case.outputs['tokens']
377+ out += [' ' + l for l in case.outputs[case.crash_kind]
360 .decode('utf-8', 'surrogateescape').split('\n')]
378 .decode('utf-8', 'surrogateescape').split('\n')]
361 if case.crash_at is not None:
379 if case.crash_at is not None:
362 out += [' at %s' % case.crash_at.label(),
380 out += [' at %s' % case.crash_at.label(),
tools/importer-test+1−1
@@ -31,4 +31,4 @@ if result.stdout != expected:
31 result.stdout.decode().splitlines(keepends=True),
31 result.stdout.decode().splitlines(keepends=True),
32 fromfile='expected tree.txt', tofile='actual types'))
32 fromfile='expected tree.txt', tofile='actual types'))
33 sys.exit(1)
33 sys.exit(1)
34−print('importer golden: 68 projections passed')
34+print('importer golden: 74 projections passed')
tools/ship+26−10
@@ -1140,38 +1140,54 @@ def generate_tests(golden):
1140++ check-import-types
1140++ check-import-types
1141 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain])]
1141 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain])]
1142 ^- tang
1142 ^- tang
1143− ?: (lien fixtures |=(f=[module=term mold=term source=wain] ?=(~ source.f)))
1143+ =/ result (mule |.((import-types-result at src fixtures)))
1144− ~[leaf+"an imported Hoon fixture is missing or empty"]
1144+ ?: ?=(%| -.result)
1145+ [leaf+"fixture compilation or type checking crashed" p.result]
1146+ (compare (file case "types.txt") want p.result)
1147+::
1148+++ import-types-result
1149+ |= [at=path src=@t fixtures=(list [module=term mold=term source=wain])]
1150+ ^- @t
1145 =/ external=(list [module=term name=term result=*])
1151 =/ external=(list [module=term name=term result=*])
1146 %+ turn fixtures
1152 %+ turn fixtures
1147 |= fixture=[module=term mold=term source=wain]
1153 |= fixture=[module=term mold=term source=wain]
1154+ ~_ leaf+"/sur/{(trip module.fixture)}.txt fixture"
1155+ ?~ source.fixture !!
1148 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1156 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1149 =/ cor=type -:(ride -:!>(..zuse) text)
1157 =/ cor=type -:(ride -:!>(..zuse) text)
1150− =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
1151− [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
1158+ [module.fixture mold.fixture (read-named:jibb-import module.fixture mold.fixture cor)]
1152− (compare (file case "types.txt") want (golden-types-imports:jibb at src external))
1159+ (golden-types-imports:jibb at src external)
1153'''
1160'''
1154 if has_marks:
1161 if has_marks:
1155 types_helper += '''::
1162 types_helper += '''::
1156++ check-mark-types
1163++ check-mark-types
1157 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
1164 |= [case=@ta at=path src=@t want=(unit wain) fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
1158 ^- tang
1165 ^- tang
1159− ?: |((lien fixtures |=(f=[module=term mold=term source=wain] ?=(~ source.f))) (lien marks |=(m=[name=term source=wain] ?=(~ source.m))))
1166+ =/ result (mule |.((mark-types-result at src fixtures marks)))
1160− ~[leaf+"an imported Hoon fixture is missing or empty"]
1167+ ?: ?=(%| -.result)
1168+ [leaf+"fixture compilation or type checking crashed" p.result]
1169+ (compare (file case "types.txt") want p.result)
1170+::
1171+++ mark-types-result
1172+ |= [at=path src=@t fixtures=(list [module=term mold=term source=wain]) marks=(list [name=term source=wain])]
1173+ ^- @t
1161 =/ external=(list [module=term name=term result=*])
1174 =/ external=(list [module=term name=term result=*])
1162 %+ turn fixtures
1175 %+ turn fixtures
1163 |= fixture=[module=term mold=term source=wain]
1176 |= fixture=[module=term mold=term source=wain]
1177+ ~_ leaf+"/sur/{(trip module.fixture)}.txt fixture"
1178+ ?~ source.fixture !!
1164 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1179 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1165 =/ cor=type -:(ride -:!>(..zuse) text)
1180 =/ cor=type -:(ride -:!>(..zuse) text)
1166− =/ typ=type (~(play ut cor) (ream (cat 3 '*' mold.fixture)))
1167− [module.fixture mold.fixture (read-mold-in:jibb-import module.fixture mold.fixture typ cor)]
1181+ [module.fixture mold.fixture (read-named:jibb-import module.fixture mold.fixture cor)]
1168 =/ mark-external=(list [name=term result=*])
1182 =/ mark-external=(list [name=term result=*])
1169 %+ turn marks
1183 %+ turn marks
1170 |= fixture=[name=term source=wain]
1184 |= fixture=[name=term source=wain]
1185+ ~_ leaf+"/mar/{(trip name.fixture)}.txt fixture"
1186+ ?~ source.fixture !!
1171 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1187 =/ text=@t (rap 3 (turn source.fixture |=(line=@t (cat 3 line '\\0a'))))
1172 =/ cor=type -:(ride -:!>(..zuse) text)
1188 =/ cor=type -:(ride -:!>(..zuse) text)
1173 [name.fixture (read-mark:jibb-import name.fixture cor)]
1189 [name.fixture (read-mark:jibb-import name.fixture cor)]
1174− (compare (file case "types.txt") want (golden-types-with-marks:jibb at src external mark-external))
1190+ (golden-types-with-marks:jibb at src external mark-external)
1175'''
1191'''
1176 return '\n'.join(lines) + '\n' + TESTS_HELPERS.replace('\n--\n', '\n' + types_helper + '--\n')
1192 return '\n'.join(lines) + '\n' + TESTS_HELPERS.replace('\n--\n', '\n' + types_helper + '--\n')
1177
1193
tools/testdata/selftest+40
@@ -287,6 +287,46 @@ def check_crash_isolated(c, tmp):
287 '--update should not write a crash:\n' + out)
287 '--update should not write a crash:\n' + out)
288
288
289
289
290+def check_fixture_crash_isolated(c, tmp):
291+ """A bad Hoon fixture must not hide the Jibb parse or other cases."""
292+ original = os.path.join(ROOT, 'tests', 'golden', 'types-import-mark')
293+ cases = os.path.join(tmp, 'fixture-cases')
294+ os.makedirs(cases)
295+ for name in ('good', 'bad', 'empty', 'mark-only'):
296+ shutil.copytree(original, os.path.join(cases, name))
297+ with open(os.path.join(cases, 'bad', 'mar', 'label.txt'), 'w') as f:
298+ f.write('not hoon\n')
299+ with open(os.path.join(cases, 'empty', 'mar', 'label.txt'), 'w'):
300+ pass
301+ # Clay's %txt mark treats the last unterminated line as a line too.
302+ good = os.path.join(cases, 'good', 'mar', 'label.txt')
303+ with open(good, 'rb') as f:
304+ without_newline = f.read().rstrip(b'\n')
305+ with open(good, 'wb') as f:
306+ f.write(without_newline)
307+ only = os.path.join(cases, 'mark-only')
308+ os.remove(os.path.join(only, 'imports.txt'))
309+ with open(os.path.join(only, 'source.jibb'), 'w') as f:
310+ f.write('/% %label\n++ label-id |= x=label x\n')
311+ status, out = golden('--dir', cases, '--show')
312+ c.expect(status == 1, 'fixture failure must fail the run: %d\n%s' % (status, out))
313+ c.expect('==> bad: tokens <==\n1:1' in out and
314+ '==> bad: tree <==\n(module' in out and
315+ '==> bad: types <==\nCRASH\n/mar/label.txt fixture' in out,
316+ 'malformed fixture should preserve parse and name the fixture:\n' + out)
317+ c.expect('==> empty: types <==\nCRASH\n/mar/label.txt fixture' in out,
318+ 'empty fixture should name the fixture:\n' + out)
319+ for name in ('good', 'mark-only'):
320+ c.expect(('==> %s: types <==\npartial inference; module not checked\n'
321+ '++ label-id: $-(@t @t)') % name in out,
322+ 'valid fixture should be isolated: ' + name + '\n' + out)
323+ expected = read(os.path.join(cases, 'bad', 'types.txt'))
324+ status, out = golden('--dir', cases, '--case', 'bad', '--update')
325+ c.expect(status == 1 and read(os.path.join(cases, 'bad', 'types.txt')) == expected and
326+ 'CRASH' in out and '/mar/label.txt fixture' in out,
327+ 'update must report the fixture crash and leave outputs alone:\n' + out)
328+
329+
290def check_eval_death(c, tmp):
330def check_eval_death(c, tmp):
291 cases = copy_cases(tmp)
331 cases = copy_cases(tmp)
292 add_case(cases, 'bails', b'bail\n')
332 add_case(cases, 'bails', b'bail\n')
tools/testdata/ship-selftest+4
@@ -177,6 +177,10 @@ def generator_checks(tmp):
177 '/tests/golden/molds/mar/label/txt' in out and
177 '/tests/golden/molds/mar/label/txt' in out and
178 '[%label mark-1-1]' in out and '[%fixture %title imp-1-1]' in out and
178 '[%label mark-1-1]' in out and '[%fixture %title imp-1-1]' in out and
179 '(golden-types-with-marks:jibb at src external mark-external)' in out, out)
179 '(golden-types-with-marks:jibb at src external mark-external)' in out, out)
180+ check('fixture crashes are caught with the source name on the ship',
181+ '(mule |.((mark-types-result at src fixtures marks)))' in out and
182+ '/mar/{(trip name.fixture)}.txt fixture' in out and
183+ '/sur/{(trip module.fixture)}.txt fixture' in out, out)
180 with open(os.path.join(folder, 'marks.txt'), 'a') as f:
184 with open(os.path.join(folder, 'marks.txt'), 'a') as f:
181 f.write('label\n')
185 f.write('label\n')
182 try:
186 try: