summaryrefslogtreecommitdiff
path: root/jstests/core/compare_timestamps.js
blob: 54db4b0fd3601846cb41ea0e9f243a8a68d7052e (plain)
1
2
3
4
5
6
7
8
9
// SERVER-21160: Check that timestamp comparisons are unsigned
(function() {
'use strict';
var t = db.compare_timestamps;
t.drop();
assert.commandWorked(t.insert({a: new Timestamp(0xffffffff, 3), b: "non-zero"}));
assert.commandWorked(t.insert({a: new Timestamp(0, 0), b: "zero"}));
assert.eq(t.find().sort({a: 1}).limit(1).next().b, "zero", "timestamp must compare unsigned");
}());