浏览代码

more tests

Vladislav Folts 9 年之前
父节点
当前提交
2b404a7785
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      test/test_unit.js

+ 6 - 0
test/test_unit.js

@@ -740,6 +740,12 @@ return {
     fail(["MODULE m; IMPORT test; PROCEDURE p(VAR b: test.Base); BEGIN CASE b OF test.Derived2: END; END p; END m.",
           "identifier 'Derived2' is not exported by module 'test'"]
         )),
+"CASE statement with imported constant": testWithModule(
+    "MODULE test; CONST i* = 0; END test.",
+    pass("MODULE m; IMPORT test; PROCEDURE p(j: INTEGER); BEGIN CASE j OF test.i: END; END p; END m."),
+    fail(["MODULE m; IMPORT test; PROCEDURE p(j: INTEGER); BEGIN CASE j OF test.unknown: END; END p; END m.",
+          "identifier 'unknown' is not exported by module 'test'"]
+        )),
 "WHILE statement": testWithContext(
     context(grammar.statement,
             "VAR b1: BOOLEAN; i1: INTEGER;"),