summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2014-09-28 21:46:13 +0200
committerGrégoire Duchêne <gduchene@awhk.org>2014-09-28 23:03:16 +0200
commit187dcd089f8a86e8d8e769769496f791d69ec09d (patch)
tree072837702a85236fbe85e88452fcf6390b2a2c82 /tests
parent19ee8bf4e7226117c47edfba623db61720a07338 (diff)
Added the first tests
Diffstat (limited to 'tests')
-rw-r--r--tests/Apply.expected8
-rw-r--r--tests/Apply.ml8
-rw-r--r--tests/Assert.expected3
-rw-r--r--tests/Assert.ml3
-rw-r--r--tests/BoxedInt.expected8
-rw-r--r--tests/BoxedInt.ml7
-rw-r--r--tests/LetIn.expected3
-rw-r--r--tests/LetIn.ml4
-rw-r--r--tests/Standard.expected6
-rw-r--r--tests/Standard.ml5
-rw-r--r--tests/TrivialMatch.expected3
-rw-r--r--tests/TrivialMatch.ml4
-rw-r--r--tests/TrivialValue.expected4
-rw-r--r--tests/TrivialValue.ml2
14 files changed, 68 insertions, 0 deletions
diff --git a/tests/Apply.expected b/tests/Apply.expected
new file mode 100644
index 0000000..661e043
--- /dev/null
+++ b/tests/Apply.expected
@@ -0,0 +1,8 @@
+Apply_0 = [6] {
+ (no name) = <abstr:247>
+ (no name) = 2
+ (no name) = 4
+ (no name) = <abstr:247>
+ (no name) = <abstr:247>
+ (no name) = 8
+}
diff --git a/tests/Apply.ml b/tests/Apply.ml
new file mode 100644
index 0000000..1cbd3e6
--- /dev/null
+++ b/tests/Apply.ml
@@ -0,0 +1,8 @@
+let f x = x + 1
+let x = f 1
+let y = f (f (f 1))
+
+let g x y z = x + y + z
+let h x y = g x y 5
+
+let z = h 1 2
diff --git a/tests/Assert.expected b/tests/Assert.expected
new file mode 100644
index 0000000..f6fb00d
--- /dev/null
+++ b/tests/Assert.expected
@@ -0,0 +1,3 @@
+Assert_0 = [1] {
+ (no name) = 0
+}
diff --git a/tests/Assert.ml b/tests/Assert.ml
new file mode 100644
index 0000000..5017ed6
--- /dev/null
+++ b/tests/Assert.ml
@@ -0,0 +1,3 @@
+let x =
+ assert (1 > 0);
+ 0
diff --git a/tests/BoxedInt.expected b/tests/BoxedInt.expected
new file mode 100644
index 0000000..e129041
--- /dev/null
+++ b/tests/BoxedInt.expected
@@ -0,0 +1,8 @@
+BoxedInt_0 = [6] {
+ (no name) = <abstr:255>
+ (no name) = <abstr:255>
+ (no name) = <abstr:255>
+ (no name) = 1
+ (no name) = 1
+ (no name) = 2
+}
diff --git a/tests/BoxedInt.ml b/tests/BoxedInt.ml
new file mode 100644
index 0000000..ad8db7c
--- /dev/null
+++ b/tests/BoxedInt.ml
@@ -0,0 +1,7 @@
+let x = Int32.of_int 1
+let y = Int64.of_int 1
+let z = Int64.to_int32 y |> Int32.add x |> Nativeint.of_int32
+
+let a = Int32.to_int x
+let b = Int64.to_int y
+let c = Nativeint.to_int z
diff --git a/tests/LetIn.expected b/tests/LetIn.expected
new file mode 100644
index 0000000..5424c00
--- /dev/null
+++ b/tests/LetIn.expected
@@ -0,0 +1,3 @@
+LetIn_0 = [1] {
+ (no name) = 2
+}
diff --git a/tests/LetIn.ml b/tests/LetIn.ml
new file mode 100644
index 0000000..6b5c3f2
--- /dev/null
+++ b/tests/LetIn.ml
@@ -0,0 +1,4 @@
+let x =
+ let y = 1 in
+
+ 2 * y
diff --git a/tests/Standard.expected b/tests/Standard.expected
new file mode 100644
index 0000000..63c8893
--- /dev/null
+++ b/tests/Standard.expected
@@ -0,0 +1,6 @@
+Hello world!
+3
+The length of [1; 2; 3] is 3
+Standard_0 = [1] {
+ (no name) = <abstr:247>
+}
diff --git a/tests/Standard.ml b/tests/Standard.ml
new file mode 100644
index 0000000..e13b98c
--- /dev/null
+++ b/tests/Standard.ml
@@ -0,0 +1,5 @@
+let ( $ ) f x = f x
+
+let () = print_endline "Hello world!"
+let () = print_int $ List.length [1; 2; 3] |> print_newline
+let () = Printf.printf "The length of [1; 2; 3] is %d\n" $ List.length [1; 2; 3]
diff --git a/tests/TrivialMatch.expected b/tests/TrivialMatch.expected
new file mode 100644
index 0000000..19d249c
--- /dev/null
+++ b/tests/TrivialMatch.expected
@@ -0,0 +1,3 @@
+TrivialMatch_0 = [1] {
+ (no name) = correct
+}
diff --git a/tests/TrivialMatch.ml b/tests/TrivialMatch.ml
new file mode 100644
index 0000000..971eafb
--- /dev/null
+++ b/tests/TrivialMatch.ml
@@ -0,0 +1,4 @@
+let x =
+ match 1 < 0 with
+ | true -> "something is terribly wrong here"
+ | false -> "correct"
diff --git a/tests/TrivialValue.expected b/tests/TrivialValue.expected
new file mode 100644
index 0000000..29a20b3
--- /dev/null
+++ b/tests/TrivialValue.expected
@@ -0,0 +1,4 @@
+TrivialValue_0 = [2] {
+ (no name) = 1
+ (no name) = 2
+}
diff --git a/tests/TrivialValue.ml b/tests/TrivialValue.ml
new file mode 100644
index 0000000..6f76e0e
--- /dev/null
+++ b/tests/TrivialValue.ml
@@ -0,0 +1,2 @@
+let x = 1
+let y = x + 1