Skip to content

Commit 67778c4

Browse files
jaredlyjordwalke
authored andcommitted
add test directory
1 parent 186c867 commit 67778c4

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

internal/Something.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
(* we can have ocaml as well as reason sources *)
33
let opt = Re.opt
44

5-
let format = "OCaml"
5+
let format = "OCaml"
6+
7+
let calculate x = x * 2

tests/jbuild

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(jbuild_version 1)
2+
3+
(executable
4+
((name test)
5+
(libraries (internal))))
6+
7+
(alias
8+
((name runtest)
9+
(deps (test.exe))
10+
(action (run ${<}))))

tests/test.re

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
let res = Internal.Something.calculate 4;
3+
let main () => {
4+
if (Internal.Something.calculate 4 != 8) {
5+
print_endline "Test failure!!";
6+
exit 1;
7+
} else {
8+
print_endline "Tests passed";
9+
exit 0;
10+
}
11+
};
12+
13+
main();

0 commit comments

Comments
 (0)