From 50186a23cd62fc6ce120f6114b428dc5c26b5a56 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 09:23:04 +0000 Subject: 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 --- tests/test_runner.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_runner.pl') 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; }; -- cgit v1.3.1-4-g156e