summaryrefslogtreecommitdiff
path: root/jstests/core/indexb.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/indexb.js')
-rw-r--r--jstests/core/indexb.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/jstests/core/indexb.js b/jstests/core/indexb.js
index d7d2e8c9f05..1262c621ba9 100644
--- a/jstests/core/indexb.js
+++ b/jstests/core/indexb.js
@@ -1,29 +1,28 @@
// unique index test for a case where the object grows
// and must move
-// see indexa.js for the test case for an update with dup id check
+// see indexa.js for the test case for an update with dup id check
// when it doesn't move
-
t = db.indexb;
t.drop();
-t.ensureIndex({a:1},true);
+t.ensureIndex({a: 1}, true);
-t.insert({a:1});
+t.insert({a: 1});
-x = { a : 2 };
+x = {
+ a: 2
+};
t.save(x);
{
+ 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.
-
- assert( t.count() == 2,"count wrong" );
- assert( t.find({a:1}).count() == 1,"bfail1" );
- assert( t.find({a:2}).count() == 1,"bfail2" );
+ 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");
}