Skip to content

Commit

Permalink
buildbot auto1.js sort() doesn't work the way we thought it did...
Browse files Browse the repository at this point in the history
  • Loading branch information
gregs committed Nov 2, 2011
1 parent 6c994c3 commit 3c5b99c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jstests/sharding/auto1.js
Expand Up @@ -58,7 +58,8 @@ counts.push( s.config.chunks.count() );

assert( counts[counts.length-1] > counts[0] , "counts 1 : " + tojson( counts ) )
sorted = counts.slice(0)
sorted.sort();
// Sort doesn't sort numbers correctly by default, resulting in fail
sorted.sort( function(a, b){ return a - b } )
assert.eq( counts , sorted , "counts 2 : " + tojson( counts ) )

print( counts )
Expand Down

0 comments on commit 3c5b99c

Please sign in to comment.