summaryrefslogtreecommitdiff
path: root/tests/typing
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-23 04:20:21 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-23 04:20:21 +0100
commitfceca1a2201eae51a5897b69ace85b0c5b773ac2 (patch)
tree586bad205d65881d68be583706e92e342aaf7a13 /tests/typing
parentd941809074955cc5e079ce48b202f24c1b3ed9c3 (diff)
downloadpetitcaml-fceca1a2201eae51a5897b69ace85b0c5b773ac2.tar.gz
petitcaml-fceca1a2201eae51a5897b69ace85b0c5b773ac2.tar.bz2
[petitcaml] Verify expected types in unit tests
Diffstat (limited to 'tests/typing')
-rw-r--r--tests/typing/base.ml13
-rw-r--r--tests/typing/funcs-rec-2args.ml2
-rw-r--r--tests/typing/funcs.ml5
-rw-r--r--tests/typing/lists.ml9
-rw-r--r--tests/typing/match.ml2
-rw-r--r--tests/typing/primitives.ml12
-rw-r--r--tests/typing/test.ml17
7 files changed, 60 insertions, 0 deletions
diff --git a/tests/typing/base.ml b/tests/typing/base.ml
index 069b4e3..a12cacd 100644
--- a/tests/typing/base.ml
+++ b/tests/typing/base.ml
@@ -1,5 +1,18 @@
(*
return : 0
+ output :
+a : int
+b : int
+c : int
+d : int
+e : int
+f : int
+t : bool
+f : bool
+l : bool
+k : bool
+a : bool
+b : bool
*)
let a = 42
let b = a + 42
diff --git a/tests/typing/funcs-rec-2args.ml b/tests/typing/funcs-rec-2args.ml
index 39cd876..c0b2c3d 100644
--- a/tests/typing/funcs-rec-2args.ml
+++ b/tests/typing/funcs-rec-2args.ml
@@ -1,5 +1,7 @@
(*
return : 0
+ output :
+ack : int -> int -> int
*)
let rec ack m n =
if m = 0 then n + 1
diff --git a/tests/typing/funcs.ml b/tests/typing/funcs.ml
index 54910e5..5474d74 100644
--- a/tests/typing/funcs.ml
+++ b/tests/typing/funcs.ml
@@ -1,5 +1,10 @@
(*
return : 0
+ output :
+f : int -> int
+g : int -> int
+fact : int -> int
+_ : int
*)
let f x = x + 42
let g = function x -> x + 42
diff --git a/tests/typing/lists.ml b/tests/typing/lists.ml
index 60bca89..a61f464 100644
--- a/tests/typing/lists.ml
+++ b/tests/typing/lists.ml
@@ -1,5 +1,14 @@
(*
return : 0
+ output :
+a : int
+b : int
+f : int -> int
+g : int -> int
+i : int -> int -> int -> int
+j : int -> int -> int -> int list
+l1 : int list
+l2 : int list
*)
let a = 42
let b = a + 42
diff --git a/tests/typing/match.ml b/tests/typing/match.ml
index b087dfd..a279e78 100644
--- a/tests/typing/match.ml
+++ b/tests/typing/match.ml
@@ -1,5 +1,7 @@
(*
return : 0
+ output :
+h : int * 'a list -> int
*)
let rec h l =
match l with
diff --git a/tests/typing/primitives.ml b/tests/typing/primitives.ml
index 30ded6b..88eec89 100644
--- a/tests/typing/primitives.ml
+++ b/tests/typing/primitives.ml
@@ -1,5 +1,17 @@
(*
return : 0
+ output :
+s : string
+i : int
+_ : unit
+_ : unit
+_ : unit
+_ : unit
+a : int
+_ : unit
+_ : unit
+_ : unit
+_ : unit
*)
let s = "test"
let i = 42
diff --git a/tests/typing/test.ml b/tests/typing/test.ml
index 458f7c0..0dd0385 100644
--- a/tests/typing/test.ml
+++ b/tests/typing/test.ml
@@ -1,5 +1,22 @@
(*
return : 0
+ output :
+a : int
+b : int
+f : int -> int
+g : int -> int
+i : int -> int -> int -> int
+_ : int
+_ : int
+_ : int list
+l1 : int list
+l2 : int list
+h : int list -> int
+k : string
+_ : string
+fact : int -> int
+noixdine : string
+test : int
*)
let a = 42
let b = a + 42