Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SERVER-7145 Updated test to reflect new treatment of undefined in jso…

…nString strict
  • Loading branch information...
commit 1b0daa024f9caf6fb972f8133a785dfac573d0fb 1 parent 43efcff
@Zarkantho Zarkantho authored milkie committed
Showing with 10 additions and 2 deletions.
  1. +10 −2 jstests/tool/exportimport1.js
View
12 jstests/tool/exportimport1.js
@@ -19,7 +19,11 @@ assert.eq( 1 , c.count() , "after restore 2" );
var doc = c.findOne();
assert.eq( 22 , doc.a , "after restore 2" );
for (var i=0; i<arr.length; i++) {
- assert.eq( arr[i], doc.b[i] , "after restore array: "+i );
+ if (typeof arr[i] == 'undefined') {
+ assert.eq( { "$undefined" : true }, doc.b[i] , "after restore array: "+i );
+ } else {
+ assert.eq( arr[i], doc.b[i] , "after restore array: "+i );
+ }
}
// now with --jsonArray
@@ -49,7 +53,11 @@ assert.soon( "c.findOne()" , "no data after sleep" );
assert.eq( 1 , c.count() , "after restore 2" );
var doc = c.findOne();
for (var i=0; i<arr.length; i++) {
- assert.eq( arr[i], doc.a[i] , "after restore array: "+i );
+ if (typeof arr[i] == 'undefined') {
+ assert.eq( { "$undefined" : true }, doc.a[i] , "after restore array: "+i );
+ } else {
+ assert.eq( arr[i], doc.a[i] , "after restore array: "+i );
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.