summaryrefslogtreecommitdiff
path: root/jstests/indexb.js
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-06-19 16:03:44 -0400
committerDwight <dmerriman@gmail.com>2009-06-19 16:03:44 -0400
commitaaa1769381674b1ae8cf09005f5949f9a78c7141 (patch)
treefff1ce3a45416fc956e62f02f7aa823e04e3e60e /jstests/indexb.js
parent5b8ca64dbb02efe31cdc54b7870b5dc6965ef22a (diff)
downloadmongo-aaa1769381674b1ae8cf09005f5949f9a78c7141.tar.gz
fix bug SERVER-96 update that changes unique index field disregards unique constraint
Diffstat (limited to 'jstests/indexb.js')
-rw-r--r--jstests/indexb.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/jstests/indexb.js b/jstests/indexb.js
index 78f873e867c..5507fee8460 100644
--- a/jstests/indexb.js
+++ b/jstests/indexb.js
@@ -15,17 +15,16 @@ t.insert({a:1});
x = { a : 2 };
t.save(x);
-print("test commented out indexb.js");
-if( 0 ) {
+{
-assert( t.count() == 2, "count wrong B");
+ assert( t.count() == 2, "count wrong B");
-x.a = 1;
-x.filler = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
-t.save(x); // should fail, not unique.
+ x.a = 1;
+ x.filler = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
+ t.save(x); // should fail, not unique.
-assert( t.count() == 2,"count wrong" );
-assert( t.find({a:1}).count() == 1,"bfail1" );
-assert( t.find({a:2}).count() == 1,"bfail2" );
+ assert( t.count() == 2,"count wrong" );
+ assert( t.find({a:1}).count() == 1,"bfail1" );
+ assert( t.find({a:2}).count() == 1,"bfail2" );
}