Skip to content

Commit

Permalink
more tests, #53
Browse files Browse the repository at this point in the history
  • Loading branch information
bahuljain committed May 2, 2016
1 parent 720266f commit ff5e2fa
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/compiler-tests/fail-cons.jsjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
val x = [1,2,3,3,4];

val _ = "hello" :: x;
1 change: 1 addition & 0 deletions test/compiler-tests/fail-cons.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Type error: expected value of type 'string', got a value of type 'num' instead
5 changes: 5 additions & 0 deletions test/compiler-tests/fail-faulty_iter.jsjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
val l = [1,2,3,4,5];

val sq = /\(x) => x * x;

List.iter(sq, l);
1 change: 1 addition & 0 deletions test/compiler-tests/fail-faulty_iter.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Type error: expected value of type 'unit', got a value of type 'num' instead
7 changes: 7 additions & 0 deletions test/compiler-tests/pass-empty_list.jsjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
val x = [];

val _ = 4 :: x;

val _ = "hello" :: x;

print(empty?(x));
1 change: 1 addition & 0 deletions test/compiler-tests/pass-empty_list.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
true

0 comments on commit ff5e2fa

Please sign in to comment.