diff --git a/src/error_tests.zig b/src/error_tests.zig index f3eb4ba..bd7aac3 100644 --- a/src/error_tests.zig +++ b/src/error_tests.zig @@ -14,7 +14,7 @@ test "compiler: unknown global variable" { ); } -test "compiler: global variable shadowing" { +test "compiler: duplicate variable declarations" { try testEqual( \\VAR a = 0 \\VAR b = 2 @@ -28,6 +28,33 @@ test "compiler: global variable shadowing" { ); } +test "compiler: duplicate knot declarations" { + try testEqual( + \\== a + \\== a + , + \\:2:1: error: duplicate identifier + \\2 | == a + \\ | ^ + \\ + , + ); +} + +test "compiler: duplicate mixed declarations" { + try testEqual( + \\VAR a = 1 + \\== a + \\Hello, world! + , + \\:1:1: error: duplicate identifier + \\1 | VAR a = 1 + \\ | ^ + \\ + , + ); +} + test "compiler: invalid divert target" { try testEqual( \\-> foo