Add more forall test cases.

This commit is contained in:
Gavin Schulz
2015-01-14 22:51:34 -08:00
parent 7716ad6263
commit f2b334d7d2
5 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ var a = [1, 2, 3]
var b = a.forall {|x| x > 1 }
IO.print(b) // expect: false
var c = a.forall {|x| x.toString }
IO.print(c) // expect: false
var d = a.forall {|x| x > 0 }
IO.print(d) // expect: true
var e = [].forall {|x| false }
IO.print(e) // expect: true
@@ -0,0 +1 @@
[1, 2, 3].forall {|x| "string" } // expect runtime error: String does not implement method '!' with 0 arguments.
+1
View File
@@ -0,0 +1 @@
[1, 2, 3].forall("string") // expect runtime error: String does not implement method 'call' with 1 argument.