diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 09:23:04 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 09:23:04 +0000 |
| commit | 50186a23cd62fc6ce120f6114b428dc5c26b5a56 (patch) | |
| tree | fb36447a7f8c932fcf2cd745901b538912eacfae /tests/test_runner.pl | |
| parent | 9467ae311ddc0ce8b4c329f3dbcec88fb279719d (diff) | |
test(multifile): cover imports, shared globals and exception propagation
Allow fixtures to pass ordered source lists and require file-qualified
negative diagnostics. Add native and runner cases for cross-unit calls,
global mutation and shadowing, transitive imports, types, MAIN status,
exception catches, runtime failures and destructor unwinding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_runner.pl')
| -rw-r--r-- | tests/test_runner.pl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_runner.pl b/tests/test_runner.pl index af08556..16a0e35 100644 --- a/tests/test_runner.pl +++ b/tests/test_runner.pl @@ -52,6 +52,23 @@ for my $bad ( ok(!$ok, 'diagnostic mismatch rejected: ' . show_bytes($bad)); } +my $file_expectation = [{reason => "Expected ':'", line => 3, file => '/fixtures/lib.cps'}]; +for my $sample ( + ["error: Expected ':' at line 3 in /fixtures/lib.cps", 1], + ["error: Expected ':' at line 3 in /fixtures/program.cps", 0], + ["error: Expected ':' at line 3 in /fixtures/lib.cps.extra", 0], + ["error: Expected ':' at line 30 in /fixtures/lib.cps", 0], + ["error: Expected ':' at line 3\nerror: unrelated at line 3 in /fixtures/lib.cps", 0], +) { + my ($diagnostic, $expected) = @{$sample}; + my $ok = eval { + check_diagnostics({returncode => 1, stdout => '', + stderr => $diagnostic . "\ncompilation terminated.\n"}, $file_expectation); + 1; + }; + is($ok ? 1 : 0, $expected, 'file-qualified diagnostic: ' . show_bytes($diagnostic)); +} + my $dir = tempdir(CLEANUP => 1); my $state = commands_new($dir); my $ran = eval { run_command($state, [$^X, '-e', 'sleep 5'], $dir, '', 1); 1; }; |
