Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make index text more robust

  • Loading branch information...
commit d0fce9592dd379078e031a571878b191e89eb155 1 parent 33bd6d1
@erh erh authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 jstests/index8.js
View
13 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 );
Please sign in to comment.
Something went wrong with that request. Please try again.