summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-03-20 11:30:13 -0400
committerEliot Horowitz <eliot@10gen.com>2010-03-20 11:30:13 -0400
commit1535b29e7518d6055d768f77c40210249a938992 (patch)
treedfe2283d0a74e84aee4deef7bc335829173ef0bc
parenta9e9dc70d010a93f6808b1110f4380a111f7f69d (diff)
downloadmongo-1535b29e7518d6055d768f77c40210249a938992.tar.gz
test
-rw-r--r--jstests/regex8.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/regex8.js b/jstests/regex8.js
new file mode 100644
index 00000000000..33dd74fb812
--- /dev/null
+++ b/jstests/regex8.js
@@ -0,0 +1,19 @@
+
+t = db.regex8;
+t.drop()
+
+t.insert( { _id : 1 , a : "abc" } )
+t.insert( { _ud : 2 , a : "abc" } )
+t.insert( { _id : 3 , a : "bdc" } )
+
+function test( msg ){
+ assert.eq( 3 , t.find().itcount() , msg + "1" )
+ assert.eq( 2 , t.find( { a : /a.*/ } ).itcount() , msg + "2" )
+ assert.eq( 3 , t.find( { a : /[ab].*/ } ).itcount() , msg + "3" )
+ assert.eq( 3 , t.find( { a : /[a|b].*/ } ).itcount() , msg + "4" )
+}
+
+test( "A" );
+
+t.ensureIndex( { a : 1 } )
+test( "B" )