summaryrefslogtreecommitdiff
path: root/jstests/jni2.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/jni2.js')
-rw-r--r--jstests/jni2.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/jni2.js b/jstests/jni2.js
new file mode 100644
index 0000000..221780d
--- /dev/null
+++ b/jstests/jni2.js
@@ -0,0 +1,22 @@
+
+t = db.jni2;
+t.remove( {} );
+
+db.jni2t.remove( {} );
+
+assert.eq( 0 , db.jni2t.find().length() , "A" );
+
+t.save( { z : 1 } );
+t.save( { z : 2 } );
+assert.throws( function(){
+ t.find( { $where :
+ function(){
+ db.jni2t.save( { y : 1 } );
+ return 1;
+ }
+ } ).length();
+} , "can't save from $where" );
+
+assert.eq( 0 , db.jni2t.find().length() , "B" )
+
+assert(t.validate().valid , "E");