feat: error message for unknown global variables
This commit is contained in:
parent
c940374f27
commit
47351cd6f9
6 changed files with 184 additions and 89 deletions
|
|
@ -1,6 +1,18 @@
|
|||
const std = @import("std");
|
||||
const Compilation = @import("compile.zig").Compilation;
|
||||
|
||||
test "compiler: unknown global variable" {
|
||||
try testEqual(
|
||||
\\{a}
|
||||
,
|
||||
\\<STDIN>:1:2: error: unknown global variable
|
||||
\\1 | {a}
|
||||
\\ | ^
|
||||
\\
|
||||
,
|
||||
);
|
||||
}
|
||||
|
||||
test "compiler: global variable shadowing" {
|
||||
try testEqual(
|
||||
\\VAR a = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue