Skip to content

Commit 86b6d71

Browse files
committed
new: add Local test
1 parent 8fcf33e commit 86b6d71

File tree

1 file changed

+8
-3
lines changed
  • lambda-buffers-compiler/test/Test/KindCheck

1 file changed

+8
-3
lines changed

lambda-buffers-compiler/test/Test/KindCheck/Errors.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import LambdaBuffers.Compiler.KindCheck (check_)
44
import LambdaBuffers.Compiler.ProtoCompat.Types (CompilerError (CompKindCheckError), KindCheckError (UnboundTyRefError, UnboundTyVarError))
55
import Test.Tasty (TestTree, testGroup)
66
import Test.Tasty.HUnit (testCase, (@?=))
7-
import Test.Utils.CompilerInput (compilerInput'undefinedForeignTyRef, compilerInput'undefinedVariable)
8-
import Test.Utils.TyDef (tyDef'undefinedForeignTyRef, tyDef'undefinedForeignTyRef'TyRef, tyDef'undefinedVar, tyDef'undefinedVar'var)
7+
import Test.Utils.CompilerInput (compilerInput'undefinedForeignTyRef, compilerInput'undefinedLocalTyRef, compilerInput'undefinedVariable)
8+
import Test.Utils.TyDef (tyDef'undefinedForeignTyRef, tyDef'undefinedForeignTyRef'TyRef, tyDef'undefinedLocalTyRef, tyDef'undefinedLocalTyRef'TyRef, tyDef'undefinedVar, tyDef'undefinedVar'var)
99

1010
testGKindCheckErrors :: TestTree
11-
testGKindCheckErrors = testGroup "Kind Check Error Tests" [undefinedVariable, undefinedLocalTyRef]
11+
testGKindCheckErrors = testGroup "Kind Check Error Tests" [undefinedVariable, undefinedLocalTyRef, undefinedForeignTyRef]
1212

1313
undefinedVariable :: TestTree
1414
undefinedVariable =
@@ -17,5 +17,10 @@ undefinedVariable =
1717

1818
undefinedLocalTyRef :: TestTree
1919
undefinedLocalTyRef =
20+
testCase "Catch undefined Local TyRef in Type Definition." $
21+
check_ compilerInput'undefinedLocalTyRef @?= Left (CompKindCheckError $ UnboundTyRefError tyDef'undefinedLocalTyRef tyDef'undefinedLocalTyRef'TyRef)
22+
23+
undefinedForeignTyRef :: TestTree
24+
undefinedForeignTyRef =
2025
testCase "Catch undefined Foreign TyRef in Type Definition." $
2126
check_ compilerInput'undefinedForeignTyRef @?= Left (CompKindCheckError $ UnboundTyRefError tyDef'undefinedForeignTyRef tyDef'undefinedForeignTyRef'TyRef)

0 commit comments

Comments
 (0)