Sha256: 2cf6eac09bea6df9f22f4c1b5d504ee02e861e5d86495ceea2d65c4a7d311dc6

Contents?: true

Size: 1.23 KB

Versions: 35

Compression:

Stored size: 1.23 KB

Contents

// ========================================================================
// SC.isEqual Tests
// ========================================================================
/*globals module test */

var StringA, StringB, StringC;

module("String's - isEqual", {
	
	setup: function(){
	StringA = "Hello";
	StringB = "Hi";
	StringC = "Hello";
    }

});

test("strings should be equal ",function(){
	equals(SC.isEqual(StringA,StringB),false);
	equals(SC.isEqual(StringA,StringC),true);
});

var num1, num2, num3;

module("Number's - isEqual",{
 
     setup: function(){
	 num1 = 24;
	 num2 = 24;
	 num3 = 21;
     }

});
 
test("numericals should be equal ",function(){
    equals(SC.isEqual(num1,num2),true);
	equals(SC.isEqual(num1,num3),false);
}); 

var objectA,objectB, objectC; //global variables

module("Array's - isEqual",{
	
	setup: function(){
	objectA = [1,2];
	objectB = [1,2];
	objectC = [1];	
	}
	
});
	
test("array should be equal  ",function(){
	// NOTE: We don't test for array contents -- that would be too expensive.
	equals(SC.isEqual(objectA,objectB),false, 'two array instances with the same values should not be equal');
	equals(SC.isEqual(objectA,objectC),false, 'two array instances with different values should not be equal');
});	



	

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
sproutcore-1.4.5 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.5-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.4-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.4 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.3.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.3-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.3 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.2-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.1-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.0-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.0 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.0.rc.5 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.0.rc.4 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.0.rc.3 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.0.rc.2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.4.0.rc lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.0.1049.pre.2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js
sproutcore-1.0.1049.pre.1 frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js