1
0
forked from Mirror/wren

Test that multiple closures of the same code are unequal.

This commit is contained in:
Bob Nystrom
2016-03-26 14:22:38 -07:00
parent 6dc4286ffa
commit 694186810b

View File

@ -14,3 +14,10 @@ System.print(Fn.new { 123 } != "fn 123") // expect: true
var f = Fn.new { 123 }
System.print(f == f) // expect: true
System.print(f != f) // expect: false
// Closures for the same function are not equal.
var fns = []
for (i in 1..2) {
fns.add(Fn.new { 123 })
}
System.print(fns[0] == fns[1]) // expect: false