Sha256: dfc47954c20134a5d63a0571a9ed8b8a1dcb6729a2bcc5efdca169c39ee20470

Contents?: true

Size: 1.23 KB

Versions: 27

Compression:

Stored size: 1.23 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Apple Inc. and contributors.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================
/*globals module ok equals same test MyApp */

// test parsing of query string
var v = [];
module("SC.compare()", {
  setup: function() {
    // setup dummy data
    v[0]  = null;
    v[1]  = false;
    v[2]  = true;
    v[3]  = -12;
    v[4]  = 3.5;
    v[5]  = 'a string';
    v[6]  = 'another string';
    v[7]  = 'last string';
    v[8]  = [1,2];
    v[9]  = [1,2,3];
    v[10] = [1,3];
    v[11] = {a: 'hash'};
    v[12] = SC.Object.create();
    v[13] = function (a) {return a;};
  }
});


// ..........................................................
// TESTS
// 

test("ordering should work", function() {
  for (var j=0; j < v.length; j++) {
    equals(SC.compare(v[j],v[j]), 0, j +' should equal itself');
    for (var i=j+1; i < v.length; i++) {
      equals(SC.compare(v[j],v[i]), -1, 'v[' + j + '] (' + SC.typeOf(v[j]) + ') should be smaller than v[' + i + '] (' + SC.typeOf(v[i]) + ')' );
    }
    
  }
}); 
  

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.rc.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.rc.2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.rc.2-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.rc.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.rc.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.rc.1-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.beta.3-x86-mingw32 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.beta.3-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.beta.3 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js
sproutcore-1.6.0.beta.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js