Sha256: 5ecd9e466958c2b98510178163d179e6cfa5b7796ad5544a21072ec35647f18e

Contents?: true

Size: 1.4 KB

Versions: 9

Compression:

Stored size: 1.4 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#min");

test("newly created index", function() {
  var set = SC.IndexSet.create();
  equals(set.get('min'), -1, 'min should be -1');
});

test("after adding one range", function() {
  var set = SC.IndexSet.create().add(4,2);
  equals(set.get('min'),4, 'min should be lowest index');
});

test("after adding range then removing part of range", function() {
  var set = SC.IndexSet.create().add(4,4).remove(2,4);
  equals(set.get('min'),6, 'min should be lowest index');
});

test("after adding range several disjoint ranges", function() {
  var set = SC.IndexSet.create().add(6000).add(4,4);
  equals(set.get('min'),4, 'min should be lowest index');
});

test("after removing disjoint range", function() {
  var set = SC.IndexSet.create().add(4,2).add(6000).remove(2,10);
  equals(set.get('min'),6000, 'min should be lowest index');
});

test("after removing all ranges", function() {
  var set = SC.IndexSet.create().add(4,2).add(6000).remove(3,6200);
  equals(set.get('min'), -1, 'min should be back to -1 with no content');
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090720093355 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.0.20090720202429 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.0.20090721125122 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.126 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.20090721145251 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.20090721145280 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.20090721145281 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.20090721145282 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js
sproutit-sproutcore-1.0.203 frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js