Update tests to cover the bugs that got reported leading up to 0.9
This commit is contained in:
parent
bc0c6a4410
commit
fbad8eaab2
15 changed files with 36 additions and 21 deletions
6
tests/good/AliasSubstitution.elm
Normal file
6
tests/good/AliasSubstitution.elm
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
type Vec2Ext a = { a | x:Float, y:Float }
|
||||
type Vec2 = Vec2Ext {}
|
||||
|
||||
extractVec : Vec2Ext a -> Vec2
|
||||
extractVec v = { x = v.x, y = v.y }
|
|
@ -1,3 +0,0 @@
|
|||
let apply f x = f x
|
||||
id x = x
|
||||
in apply id (apply id (apply id (apply id (apply id (apply id 4)))))
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
trickyID x = let y = x in y
|
||||
|
||||
quad f = twice (twice f)
|
||||
twice f x = f (f x)
|
||||
|
||||
n = quad (quad trickyID) 4
|
||||
c = twice trickyID 'a'
|
3
tests/good/Soundness/Apply.elm
Normal file
3
tests/good/Soundness/Apply.elm
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
apply f = let g x = f x
|
||||
in g
|
4
tests/good/Soundness/ApplyAnnotated.elm
Normal file
4
tests/good/Soundness/ApplyAnnotated.elm
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
apply : (a -> b) -> a -> b
|
||||
apply f = let g x = f x
|
||||
in g
|
|
@ -1,2 +1,3 @@
|
|||
test =
|
||||
|
||||
myId =
|
||||
let id x = x in id
|
|
@ -1,3 +1,4 @@
|
|||
test = let id : a -> a
|
||||
|
||||
myId = let id : a -> a
|
||||
id x = x
|
||||
in id
|
2
tests/good/Soundness/TrickyId.elm
Normal file
2
tests/good/Soundness/TrickyId.elm
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
myId x = let y = x in y
|
3
tests/good/Soundness/TrickyIdAnnotated.elm
Normal file
3
tests/good/Soundness/TrickyIdAnnotated.elm
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
myId : a -> a
|
||||
myId x = let y = x in y
|
|
@ -1 +0,0 @@
|
|||
test x = let y = x in y
|
|
@ -1,2 +0,0 @@
|
|||
test f = let g x = f x
|
||||
in g
|
|
@ -1,2 +0,0 @@
|
|||
test : a -> a
|
||||
test x = let y = x in y
|
|
@ -1,3 +0,0 @@
|
|||
test : (a -> b) -> a -> b
|
||||
test f = let g x = f x
|
||||
in g
|
6
tests/good/Unify/LockedVars.elm
Normal file
6
tests/good/Unify/LockedVars.elm
Normal file
|
@ -0,0 +1,6 @@
|
|||
-- unify flexible and locked types
|
||||
import Dict
|
||||
|
||||
multiplyKey ((i,j), _) = (i*j)
|
||||
|
||||
x = map multiplyKey (Dict.toList (Dict.singleton (1,2) 0))
|
8
tests/good/Unify/NonHomogeneousRecords.elm
Normal file
8
tests/good/Unify/NonHomogeneousRecords.elm
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
type Thing = { x:Float, y:Float }
|
||||
|
||||
f : Thing -> Thing
|
||||
f t =
|
||||
let x = t.x
|
||||
y = t.y
|
||||
in t
|
Loading…
Reference in a new issue