From 0ca01a91ae0a3562e54c226e7b9512feb2ea83d0 Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Thu, 25 Mar 2010 19:21:32 +0100 Subject: Imported Upstream version 1.4.0 --- jstests/index8.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'jstests/index8.js') diff --git a/jstests/index8.js b/jstests/index8.js index 09a0645..719ad2d 100644 --- a/jstests/index8.js +++ b/jstests/index8.js @@ -9,11 +9,14 @@ t.ensureIndex( { c: 1 }, [ false, "cIndex" ] ); checkIndexes = function( num ) { // printjson( db.system.indexes.find( { ns: "test.jstests_index8" } ).toArray() ); - indexes = db.system.indexes.find( { ns: "test.jstests_index8" } ).sort( { key: 1 } ); - assert( !indexes[ 0 ].unique , "A" + num ); - assert( indexes[ 1 ].unique , "B" + num ); - assert( !indexes[ 2 ].unique , "C" + num ); - assert.eq( "cIndex", indexes[ 2 ].name , "D" + num ); + indexes = db.system.indexes.find( { ns: "test.jstests_index8" } ).sort( { key: 1 } ).toArray(); + var start = 0; + if ( indexes[0].name == "_id_" ) + start = 1; + assert( !indexes[ start ].unique , "A" + num ); + assert( indexes[ start + 1 ].unique , "B" + num + " " + tojson( indexes[start+1] ) ); + assert( !indexes[ start + 2 ].unique , "C" + num ); + assert.eq( "cIndex", indexes[ start + 2 ].name , "D" + num ); } checkIndexes( 1 ); -- cgit v1.2.3