Update tests to cover the bugs that got reported leading up to 0.9

This commit is contained in:
Evan Czaplicki 2013-08-13 18:31:15 -07:00
parent bc0c6a4410
commit fbad8eaab2
15 changed files with 36 additions and 21 deletions

View 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 }

View file

@ -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)))))

View file

@ -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'

View file

@ -0,0 +1,3 @@
apply f = let g x = f x
in g

View file

@ -0,0 +1,4 @@
apply : (a -> b) -> a -> b
apply f = let g x = f x
in g

View file

@ -1,2 +1,3 @@
test =
myId =
let id x = x in id

View file

@ -1,3 +1,4 @@
test = let id : a -> a
myId = let id : a -> a
id x = x
in id

View file

@ -0,0 +1,2 @@
myId x = let y = x in y

View file

@ -0,0 +1,3 @@
myId : a -> a
myId x = let y = x in y

View file

@ -1 +0,0 @@
test x = let y = x in y

View file

@ -1,2 +0,0 @@
test f = let g x = f x
in g

View file

@ -1,2 +0,0 @@
test : a -> a
test x = let y = x in y

View file

@ -1,3 +0,0 @@
test : (a -> b) -> a -> b
test f = let g x = f x
in g

View 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))

View 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