Skip to content

Commit

Permalink
added regression test for issue jashkenas#95
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Mar 4, 2011
1 parent 59ef91e commit 1f2c9c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ $(document).ready(function() {

test("objects: keys", function() {
equals(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object');
// the test above is not safe because it relies on for-in enumeration order
var a = []; a[1] = 0;
equals(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95');
});

test("objects: values", function() {
Expand Down

0 comments on commit 1f2c9c5

Please sign in to comment.