Permalink
Browse files

test

  • Loading branch information...
1 parent a9e9dc7 commit 1535b29e7518d6055d768f77c40210249a938992 @erh erh committed Mar 20, 2010
Showing with 19 additions and 0 deletions.
  1. +19 −0 jstests/regex8.js
View
@@ -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" )

0 comments on commit 1535b29

Please sign in to comment.