Skip to content

Commit c46e419

Browse files
committed
SERVER-12127 migrate js tests to jscore suite when not related to writes
Added relevant getLastError tests to jstests/gle/core
1 parent a4abdfc commit c46e419

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

jstests/error4.js

Lines changed: 0 additions & 7 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

jstests/gle/core/gle_example.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,29 @@ var coll = db.getCollection("gle_example");
66
coll.drop();
77

88
coll.insert({ hello : "world" });
9-
assert.eq( null, coll.getDB().getLastError() );
9+
assert.eq( null, coll.getDB().getLastError() );
10+
11+
// Error on insert.
12+
coll.drop();
13+
coll.insert({ _id: 1 });
14+
coll.insert({ _id: 1 });
15+
var gle = db.getLastErrorObj();
16+
assert.neq(null, gle.err);
17+
18+
// New requests should clear gle.
19+
coll.findOne();
20+
gle = db.getLastErrorObj();
21+
assert.eq(null, gle.err);
22+
23+
// Error on upsert.
24+
coll.drop();
25+
coll.insert({ _id: 1 });
26+
coll.update({ y: 1 }, { _id: 1 }, true);
27+
gle = db.getLastErrorObj();
28+
assert.neq(null, gle.err);
29+
30+
// Error on index creation.
31+
coll.ensureIndex({ x: 'invalid' });
32+
gle = db.getLastErrorObj();
33+
assert.neq(null, gle.err);
34+
File renamed without changes.

0 commit comments

Comments
 (0)