Sha256: d072fd38366c4e1ab8a8295be1a386ee723d333d1c94a0013ce08894cd4b9723
Contents?: true
Size: 1.37 KB
Versions: 7
Compression:
Stored size: 1.37 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2009 Apple Inc. and contributors. // License: Licensed under MIT license (see license.js) // ========================================================================== /*global module test equals context ok same notest */ module("SC.IndexSet#create"); test("create with no params", function() { var set = SC.IndexSet.create(); equals(set.get('length'), 0, 'should have no indexes'); }); test("create with just index", function() { var set = SC.IndexSet.create(4); equals(set.get('length'),1, 'should have 1 index'); equals(set.contains(4), YES, 'should contain index'); equals(set.contains(5), NO, 'should not contain 5'); }); test("create with index and length", function() { var set = SC.IndexSet.create(4, 2); equals(set.get('length'),2, 'should have 2 indexes'); equals(set.contains(4), YES, 'should contain 4'); equals(set.contains(5), YES, 'should contain 5'); }); test("create with other set", function() { var first = SC.IndexSet.create(4,2); var set = SC.IndexSet.create(first); equals(set.get('length'),2, 'should have same number of indexes (2)'); equals(set.contains(4), YES, 'should contain 4, just like first'); equals(set.contains(5), YES, 'should contain 5, just like first'); });
Version data entries
7 entries across 7 versions & 1 rubygems