Sha256: a4b0a8db12093580903b29ccf38571fb7ba590366e9197569481f52d682b7aca

Contents?: true

Size: 1.26 KB

Versions: 41

Compression:

Stored size: 1.26 KB

Contents

// ==========================================================================
// Project:   SproutCore Costello - Property Observing Library
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

var set ;

module("SC.IndexSet.indexAfter", {
  setup: function() {
    set = SC.IndexSet.create(5).add(10,5).add(100);
  }
});

test("no earlier index in set", function(){ 
  equals(set.indexAfter(3), 5, 'set.indexAfter(3) in %@ should start of first index range'.fmt(set));
});

test("with index after end of set", function() {
  equals(set.indexAfter(1000), -1, 'set.indexAfter(1000) in %@ should return -1'.fmt(set));
});

test("inside of multi-index range", function() {
  equals(set.indexAfter(12), 13, 'set.indexAfter(12) in %@ should return next index'.fmt(set));
});

test("end of multi-index range", function() {
  equals(set.indexAfter(14), 100, 'set.indexAfter(14) in %@ should start of next range'.fmt(set));
});


test("single index range", function() {
  equals(set.indexAfter(5), 10, 'set.indexAfter(5) in %@ should start of next range multi-index range'.fmt(set));
});



Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js