summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Dirolf <mike@10gen.com>2009-06-22 15:32:33 -0400
committerMike Dirolf <mike@10gen.com>2009-06-22 15:32:33 -0400
commit9cbee3d81f889cc9233ce84e0041b72fe4ddc697 (patch)
treeae3cf330b8a7cb8e21a520259829db4e0a5f9310
parent4a71c33456902b60fb28bde667abf9c7d54c1575 (diff)
downloadmongo-9cbee3d81f889cc9233ce84e0041b72fe4ddc697.tar.gz
minor: test for leading whitespace in where clauses
-rw-r--r--jstests/where2.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/where2.js b/jstests/where2.js
new file mode 100644
index 00000000000..ae7addb4402
--- /dev/null
+++ b/jstests/where2.js
@@ -0,0 +1,10 @@
+
+t = db.getCollection( "where1" );
+t.drop();
+
+t.save( { a : 1 } );
+t.save( { a : 2 } );
+t.save( { a : 3 } );
+
+assert.eq( 1 , t.find( { $where : "this.a == 2" } ).toArray().length , "A" );
+assert.eq( 1 , t.find( { $where : "\nthis.a == 2" } ).toArray().length , "B" );