aboutsummaryrefslogtreecommitdiff
path: root/tests/drivers
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 09:46:14 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 09:46:14 +0330
commit903e57850e6678f85c5f26cecf6ec318564ae139 (patch)
tree19fb6944dc0fdcf4c54a1582c0cfb6573f93aa26 /tests/drivers
parentxref: baseline records the prover's writers of ft_ln (bin, kw_for), xub and x... (diff)
parentlsp: prefer the rt import fix when a library group wraps the same name (diff)
merge work/stdio: std.Io and one-level module completion
Diffstat (limited to 'tests/drivers')
-rw-r--r--tests/drivers/completion_test.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/drivers/completion_test.js b/tests/drivers/completion_test.js
index f1ee5e6..4b767a1 100644
--- a/tests/drivers/completion_test.js
+++ b/tests/drivers/completion_test.js
@@ -104,4 +104,15 @@ assert.match(get(r.items, 'map').documentation.value, /transform.*each element/)
assert.ok(!r.items.some(c => ['push', 'pop', 'resize'].includes(c.label)), 'library algorithms do not make a fixed array growable');
r = complete('include rt; fn main() { int[?] items = {}; items.| }');
assert.ok(!r.items.some(c => ['map', 'filter'].includes(c.label)), 'library methods require an explicit import');
-console.log('ok completion: signatures, docs, fuzzy ranking, scope, array members, shadowing and consumed lifetimes');
+r = complete('include std; fn main() { std.| }');
+for (const name of ['File', 'Io', 'Text', 'Host', 'argv', 'bnew']) get(r.items, name);
+assert.ok(!r.items.some(c => c.label.includes('.')), 'module completion lists one level: ' + r.items.filter(c => c.label.includes('.')).map(c => c.label));
+r = complete('include std; fn main() { std.File.| }');
+for (const name of ['read', 'write']) get(r.items, name);
+assert.ok(!r.items.some(c => ['Io', 'File', 'main', 'int'].includes(c.label)), 'group completion lists only its members');
+r = complete('include std; fn main() { std.Io.| }');
+for (const name of ['print', 'println', 'put_n', 'put_f', 'getline']) get(r.items, name);
+assert.ok(!r.items.some(c => ['write', 'itoa', 'main', 'int'].includes(c.label)), 'std.Io. lists only Io members');
+r = complete('include std; fn main() { std.Io.pr| }');
+assert.deepStrictEqual(r.items.map(c => c.label).sort(), ['print', 'println']);
+console.log('ok completion: signatures, docs, fuzzy ranking, scope, array members, shadowing, consumed lifetimes and one level of a module path');