Permalink
Browse files

Update _.all() test to return true for empty arrays.

Regardless of the test function, the JS version of _.all returns
true for any empty array. This test now fails, paving the way for us to
merge in a fix.
  • Loading branch information...
1 parent 087d5d7 commit b740939108838d133f35326210ea61040b1f760c @amacdougall committed Dec 16, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 flexUnitTests/src/test/com/alanmacdougall/underscore/CollectionsTestCase.as
@@ -173,8 +173,8 @@ public class CollectionsTestCase {
_([1, 2, 3]).all(function(n:int):Boolean {return n > 0;}));
Assert.assertFalse("Invalid true result from all() test.",
_([1, 2, 3]).all(function(n:int):Boolean {return n < 1;}));
- Assert.assertFalse("Invalid true result from all() test on empty collection.",
- _([]).all(function(n:int):Boolean {return true;}));
+ Assert.assertTrue("Invalid false result from all() test on empty collection.",
+ _([]).all(function(n:int):Boolean {return false;}));
}
[Test]
@@ -226,7 +226,7 @@ public class CollectionsTestCase {
var dates:Array = [
new Date(1776, 07, 04), // American independence
new Date(1949, 10, 01), // Mao declares PRC
- new Date(1789, 07, 14) // Bastille Day
+ new Date(1789, 07, 14) // Bastille Day
];
Assert.assertEquals("Failed to get max number.", 4, _(numbers).max());

0 comments on commit b740939

Please sign in to comment.