found incorrectly accepted program. added test
This commit is contained in:
parent
05333c5689
commit
368413515b
1 changed files with 25 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ main = hspec $ do
|
||||||
ok2
|
ok2
|
||||||
bad1
|
bad1
|
||||||
bad2
|
bad2
|
||||||
|
bad3
|
||||||
|
|
||||||
ok1 =
|
ok1 =
|
||||||
specify "Basic polymorphism with multiple type variables" $
|
specify "Basic polymorphism with multiple type variables" $
|
||||||
|
|
@ -57,6 +58,17 @@ bad2 =
|
||||||
)
|
)
|
||||||
`shouldSatisfy` bad
|
`shouldSatisfy` bad
|
||||||
|
|
||||||
|
bad3 =
|
||||||
|
specify "Using a concrete function on a skolem variable should not succeed" $
|
||||||
|
run
|
||||||
|
( D.do
|
||||||
|
bool
|
||||||
|
_not
|
||||||
|
"f : a -> Bool () ;"
|
||||||
|
" f x = not x ;"
|
||||||
|
)
|
||||||
|
`shouldSatisfy` bad
|
||||||
|
|
||||||
run = typecheck <=< pProgram . myLexer
|
run = typecheck <=< pProgram . myLexer
|
||||||
|
|
||||||
ok (Right _) = True
|
ok (Right _) = True
|
||||||
|
|
@ -83,3 +95,16 @@ head = D.do
|
||||||
" case xs of {"
|
" case xs of {"
|
||||||
" Cons x xs => x ;"
|
" Cons x xs => x ;"
|
||||||
" };"
|
" };"
|
||||||
|
|
||||||
|
bool = D.do
|
||||||
|
"data Bool () where {"
|
||||||
|
" True : Bool ()"
|
||||||
|
" False : Bool ()"
|
||||||
|
"};"
|
||||||
|
|
||||||
|
_not = D.do
|
||||||
|
"not : Bool () -> Bool () ;"
|
||||||
|
"not x = case x of {"
|
||||||
|
" True => False ;"
|
||||||
|
" False => True ;"
|
||||||
|
"};"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue