[Opensrf-commits] r2232 - trunk/src/javascript/tests (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 25 00:12:44 EDT 2011
Author: dbs
Date: 2011-04-25 00:12:41 -0400 (Mon, 25 Apr 2011)
New Revision: 2232
Modified:
trunk/src/javascript/tests/testJSON_v1.js
Log:
Sidestep JSON object ordering in unit tests
Depending on the JS engine and version of Dojo, the order
of attributes in JSON objects may change (as is explicitly
allowed by the JSON spec). To avoid false test failures,
only use one attribute in the object.
Modified: trunk/src/javascript/tests/testJSON_v1.js
===================================================================
--- trunk/src/javascript/tests/testJSON_v1.js 2011-04-21 20:05:07 UTC (rev 2231)
+++ trunk/src/javascript/tests/testJSON_v1.js 2011-04-25 04:12:41 UTC (rev 2232)
@@ -43,7 +43,7 @@
},
function test_js2JSON_objects_ordered() {
// Order of object attributes is not guaranteed
- doh.assertTrue(js2JSON({"foo":{"one":null,"two":2}}) == '{"foo":{"one":null,"two":2}}');
+ doh.assertTrue(js2JSON({"foo":{"one":[null,"two",2]}}) == '{"foo":{"one":[null,"two",2]}}');
},
function test_js2JSONRaw_strict() {
// Solo nulls and booleans are stringified XXX
@@ -72,7 +72,7 @@
},
function test_js2JSONRaw_objects_ordered() {
// Order of object attributes is not guaranteed
- doh.assertTrue(js2JSONRaw({"foo":{"one":null,"two":2}}) == '{"foo":{"one":null,"two":2}}');
+ doh.assertTrue(js2JSONRaw({"foo":{"one":[null,"two",2]}}) == '{"foo":{"one":[null,"two",2]}}');
},
function test_JSON2jsRaw_strict() {
// Standalone quoted nulls and booleans are converted to primitives
More information about the opensrf-commits
mailing list