summaryrefslogtreecommitdiff
path: root/jstests/tool/csv1.js
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2011-07-01 15:57:35 -0400
committerSpencer T Brody <spencer@10gen.com>2011-07-01 15:57:35 -0400
commite27fa36b4c47b277b6e140f641a1187b712d99ca (patch)
tree3aa3b385fb33bdb26f8fa5a961c4d7c9a5e0210a /jstests/tool/csv1.js
parent184d653da333c90293855495285760c52df556dd (diff)
downloadmongo-e27fa36b4c47b277b6e140f641a1187b712d99ca.tar.gz
SERVER-2634: mongoimport imports the string "." as the number 0
Diffstat (limited to 'jstests/tool/csv1.js')
-rw-r--r--jstests/tool/csv1.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/jstests/tool/csv1.js b/jstests/tool/csv1.js
index ccf1d09e81d..5eb7ab0249a 100644
--- a/jstests/tool/csv1.js
+++ b/jstests/tool/csv1.js
@@ -4,25 +4,25 @@ t = new ToolTest( "csv1" )
c = t.startDB( "foo" );
-base = { a : 1 , b : "foo,bar\"baz,qux" , c: 5, 'd d': -6 , e: '-'};
+base = { a : 1 , b : "foo,bar\"baz,qux" , c: 5, 'd d': -6 , e: '-', f : "."};
assert.eq( 0 , c.count() , "setup1" );
c.insert( base );
delete base._id
assert.eq( 1 , c.count() , "setup2" );
-t.runTool( "export" , "--out" , t.extFile , "-d" , t.baseName , "-c" , "foo" , "--csv" , "-f" , "a,b,c,d d,e" )
+t.runTool( "export" , "--out" , t.extFile , "-d" , t.baseName , "-c" , "foo" , "--csv" , "-f" , "a,b,c,d d,e,f" )
c.drop()
assert.eq( 0 , c.count() , "after drop" )
-t.runTool( "import" , "--file" , t.extFile , "-d" , t.baseName , "-c" , "foo" , "--type" , "csv" , "-f" , "a,b,c,d d,e" );
+t.runTool( "import" , "--file" , t.extFile , "-d" , t.baseName , "-c" , "foo" , "--type" , "csv" , "-f" , "a,b,c,d d,e,f" );
assert.soon( "2 == c.count()" , "restore 2" );
a = c.find().sort( { a : 1 } ).toArray();
delete a[0]._id
delete a[1]._id
-assert.eq( tojson( { a : "a" , b : "b" , c : "c" , 'd d': "d d", e: 'e'} ) , tojson( a[1] ) , "csv parse 1" );
+assert.eq( tojson( { a : "a" , b : "b" , c : "c" , 'd d': "d d", e: 'e', f : "f"} ) , tojson( a[1] ) , "csv parse 1" );
assert.eq( tojson( base ) , tojson(a[0]) , "csv parse 0" )
c.drop()