diff options
| author | 2026-10-14 10:06:27 +0000 | |
|---|---|---|
| committer | 2026-10-14 10:06:27 +0000 | |
| commit | c2270cc944424579e4577e67ed17a66512d856b4 (patch) | |
| tree | 04fc1ede53e0cbf2c2562f724fd539836c450306 /tests/drivers/nav_test.js | |
| parent | todo: tick the spec; list the bugs its appendix b found (diff) | |
| parent | split compiler.zc into files by phase (diff) | |
Merge the compiler split into phase files
also: ca_owners in the language server keeps the owner order in a fixed
array instead of a heap list the analyzer rejected.
Diffstat (limited to 'tests/drivers/nav_test.js')
| -rw-r--r-- | tests/drivers/nav_test.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/drivers/nav_test.js b/tests/drivers/nav_test.js index 8f0d8fd..deff6f3 100644 --- a/tests/drivers/nav_test.js +++ b/tests/drivers/nav_test.js @@ -68,7 +68,10 @@ assert.strictEqual(slice(source('/std.zc'), loc[0]), 'atoi', 'a method goes to i loc = bdef('now('); assert.strictEqual(slice(source('/std.zc'), loc[0]), 'now'); assert.strictEqual(source('/std.zc'), fs.readFileSync(path.join(root, 'src', 'lib', 'std.zc'), 'utf8'), 'the embedded std is the file'); -assert.strictEqual(source('/compiler.zc'), fs.readFileSync(path.join(root, 'src', 'compiler', 'compiler.zc'), 'utf8'), 'the embedded compiler is the file'); +const parts = fs.readFileSync(path.join(root, 'src', 'compiler', 'parts'), 'utf8').split(/\r?\n/).filter(Boolean); +assert.strictEqual(source('/compiler.zc'), parts.map(n => fs.readFileSync(path.join(root, 'src', 'compiler', n), 'utf8')).join(''), 'the embedded compiler is its parts, joined in order'); +const embedded = [...fs.readFileSync(path.join(root, 'src', 'lsp', 'server.zc'), 'utf8').matchAll(/^embed "src\/compiler\/([^"]+)" as bstr/gm)].map(m => m[1]); +assert.deepStrictEqual(embedded, parts, 'src/lsp/server.zc embeds the files of src/compiler/parts, in order'); assert.strictEqual(source('/server.zc'), fs.readFileSync(path.join(root, 'src', 'lsp', 'server.zc'), 'utf8'), 'the embedded server is the file'); loc = bdef('s_to_n('); assert.ok(loc && loc.length === 1 && loc[0].uri === 'tinyvm:/rt.zc', 's_to_n opens the runtime source: ' + JSON.stringify(loc)); |
