From 230bb3670962b97b8c4719d8d030825a5460c0b6 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 6 Jul 2024 17:01:52 +0200 Subject: [PATCH] Added more tests --- tests/errors/UnknownIdentifier3.q | 3 +++ tests/errors/UnknownIdentifier4.q | 7 +++++++ tests/errors_test.go | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 tests/errors/UnknownIdentifier3.q create mode 100644 tests/errors/UnknownIdentifier4.q diff --git a/tests/errors/UnknownIdentifier3.q b/tests/errors/UnknownIdentifier3.q new file mode 100644 index 0000000..c31b354 --- /dev/null +++ b/tests/errors/UnknownIdentifier3.q @@ -0,0 +1,3 @@ +main() { + x := 1 + f(x) +} \ No newline at end of file diff --git a/tests/errors/UnknownIdentifier4.q b/tests/errors/UnknownIdentifier4.q new file mode 100644 index 0000000..a7387e2 --- /dev/null +++ b/tests/errors/UnknownIdentifier4.q @@ -0,0 +1,7 @@ +main() { + x := 1 + f(x) +} + +f(x) { + return x +} \ No newline at end of file diff --git a/tests/errors_test.go b/tests/errors_test.go index c3d2a11..d1123bb 100644 --- a/tests/errors_test.go +++ b/tests/errors_test.go @@ -35,6 +35,8 @@ var errs = []struct { {"VariableAlreadyExists.q", &errors.VariableAlreadyExists{Name: "x"}}, {"UnknownIdentifier.q", &errors.UnknownIdentifier{Name: "x"}}, {"UnknownIdentifier2.q", &errors.UnknownIdentifier{Name: "x"}}, + {"UnknownIdentifier3.q", &errors.UnknownIdentifier{Name: "f"}}, + {"UnknownIdentifier4.q", &errors.UnknownIdentifier{Name: "x"}}, {"UnusedVariable.q", &errors.UnusedVariable{Name: "x"}}, }