Changeset 14309
- Timestamp:
- 07/07/08 09:28:26 (5 months ago)
- Files:
-
- 1 modified
-
util/trunk/doh/runner.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
util/trunk/doh/runner.js
r14122 r14309 622 622 } 623 623 624 doh.isNot = doh.assertNotEqual = function(/*Object*/ notExpected, /*Object*/ actual){ 625 // summary: 626 // are the passed notexpected and actual objects/values deeply 627 // not equivalent? 628 629 // Compare undefined always with three equal signs, because undefined==null 630 // is true, but undefined===null is false. 631 if((notExpected === undefined)&&(actual === undefined)){ 632 throw new doh._AssertFailure("assertNotEqual() failed: not expected |"+notExpected+"| but got |"+actual+"|"); 633 } 634 if(arguments.length < 2){ 635 throw doh._AssertFailure("assertEqual failed because it was not passed 2 arguments"); 636 } 637 if((notExpected === actual)||(notExpected == actual)){ 638 throw new doh._AssertFailure("assertNotEqual() failed: not expected |"+notExpected+"| but got |"+actual+"|"); 639 } 640 if( (this._isArray(notExpected) && this._isArray(actual))&& 641 (this._arrayEq(notExpected, actual)) ){ 642 throw new doh._AssertFailure("assertNotEqual() failed: not expected |"+notExpected+"| but got |"+actual+"|"); 643 } 644 if( ((typeof notExpected == "object")&&((typeof actual == "object")))&& 645 (this._objPropEq(notExpected, actual)) ){ 646 throw new doh._AssertFailure("assertNotEqual() failed: not expected |"+notExpected+"| but got |"+actual+"|"); 647 } 648 return true; 649 } 650 624 651 doh._arrayEq = function(expected, actual){ 625 652 if(expected.length != actual.length){ return false; } … … 635 662 return actual instanceof Date && expected.getTime()==actual.getTime(); 636 663 } 664 var x; 637 665 // Make sure ALL THE SAME properties are in both objects! 638 for( varx in actual){ // Lets check "actual" here, expected is checked below.666 for(x in actual){ // Lets check "actual" here, expected is checked below. 639 667 if(expected[x] === undefined){ 640 668 return false; … … 642 670 }; 643 671 644 for( varx in expected){672 for(x in expected){ 645 673 if(!doh.assertEqual(expected[x], actual[x])){ 646 674 return false; … … 917 945 (function(){ 918 946 // scope protection 947 var x; 919 948 try{ 920 949 if(typeof dojo != "undefined"){ … … 963 992 // find runner.js, load _browserRunner relative to it 964 993 var scripts = document.getElementsByTagName("script"); 965 for( varx=0; x<scripts.length; x++){994 for(x=0; x<scripts.length; x++){ 966 995 var s = scripts[x].src; 967 996 if(s && (s.substr(-9) == "runner.js")){ … … 983 1012 var testUrl = ""; 984 1013 var testModule = "dojo.tests.module"; 985 for( varx=0; x<arguments.length; x++){1014 for(x=0; x<arguments.length; x++){ 986 1015 if(arguments[x].indexOf("=") > 0){ 987 1016 var tp = arguments[x].split("=");