summaryrefslogtreecommitdiff
path: root/jstests/json1.js
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2014-02-19 12:45:53 -0500
committerMatt Kangas <matt.kangas@mongodb.com>2014-03-03 22:54:10 -0500
commit3660343e0b4627d2fee4afb89b74d32644d16d18 (patch)
treeffa571e0b73ce56d73c2ae23f458f0db772ef782 /jstests/json1.js
parent9fae141a1f3fe652fa6002e47722c5ceb051cffb (diff)
downloadmongo-3660343e0b4627d2fee4afb89b74d32644d16d18.tar.gz
SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z. Include SERVER-12920 Update use_power_of_2.js Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Diffstat (limited to 'jstests/json1.js')
-rw-r--r--jstests/json1.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/jstests/json1.js b/jstests/json1.js
deleted file mode 100644
index 054a9b46047..00000000000
--- a/jstests/json1.js
+++ /dev/null
@@ -1,28 +0,0 @@
-
-x = { quotes:"a\"b" , nulls:null };
-eval( "y = " + tojson( x ) );
-assert.eq( tojson( x ) , tojson( y ) , "A" );
-assert.eq( typeof( x.nulls ) , typeof( y.nulls ) , "B" );
-
-// each type is parsed properly
-x = {"x" : null, "y" : true, "z" : 123, "w" : "foo", "a": undefined};
-assert.eq(tojson(x,"",false), '{\n\t"x" : null,\n\t"y" : true,\n\t"z" : 123,\n\t"w" : "foo",\n\t"a" : undefined\n}' , "C" );
-
-x = {"x" : [], "y" : {}};
-assert.eq(tojson(x,"",false), '{\n\t"x" : [ ],\n\t"y" : {\n\t\t\n\t}\n}' , "D" );
-
-// nested
-x = {"x" : [{"x" : [1,2,[]], "z" : "ok", "y" : [[]]}, {"foo" : "bar"}], "y" : null};
-assert.eq(tojson(x), '{\n\t"x" : [\n\t\t{\n\t\t\t"x" : [\n\t\t\t\t1,\n\t\t\t\t2,\n\t\t\t\t[ ]\n\t\t\t],\n\t\t\t"z" : "ok",\n\t\t\t"y" : [\n\t\t\t\t[ ]\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t"foo" : "bar"\n\t\t}\n\t],\n\t"y" : null\n}' , "E" );
-
-// special types
-x = {"x" : ObjectId("4ad35a73d2e34eb4fc43579a"), 'z' : /xd?/ig};
-assert.eq(tojson(x,"",false), '{\n\t"x" : ObjectId("4ad35a73d2e34eb4fc43579a"),\n\t"z" : /xd?/gi\n}' , "F" );
-
-// Timestamp type
-x = {"x" : Timestamp()};
-assert.eq(tojson(x,"",false), '{\n\t"x" : Timestamp(0, 0)\n}' , "G")
-
-// Timestamp type, second
-x = {"x" : Timestamp(10,2)};
-assert.eq(tojson(x,"",false), '{\n\t"x" : Timestamp(10, 2)\n}' , "H")