Sha256: 54d62e07a9eee78a287cf0d9eee3ce7f3eb5cc650346f8f31d27daa687212ecd

Contents?: true

Size: 1.37 KB

Versions: 17

Compression:

Stored size: 1.37 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Apple Inc. and contributors.
// License:   Licened 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

17 entries across 17 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1046 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1043 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1042 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1037 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1035 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1031 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1030 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1029 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1027 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1028 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1026 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1025 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1024 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1009 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1008 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js
sproutcore-1.0.1003 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js