diff options
author | sebastianro <sebastianro@apache.org> | 2016-04-14 10:52:11 +0200 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2016-04-23 12:25:32 +0200 |
commit | 8bef89bcf9e604d07d24cd0c9e2f5ef1bd242050 (patch) | |
tree | 5f44820290d9689a258089b319afbdf07ec479b5 | |
parent | a4d84d800b68b98b443cc39db12870e52f37de37 (diff) | |
download | couchdb-8bef89bcf9e604d07d24cd0c9e2f5ef1bd242050.tar.gz |
Improve seq num check in all_docs
-rw-r--r-- | test/javascript/tests/all_docs.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/javascript/tests/all_docs.js b/test/javascript/tests/all_docs.js index 5e4e8d13c..64524d845 100644 --- a/test/javascript/tests/all_docs.js +++ b/test/javascript/tests/all_docs.js @@ -79,18 +79,22 @@ couchTests.all_docs = function(debug) { })[0]; TEquals("1", deleted_doc.id, "deletes"); + // (remember old seq) + var orig_doc = changes.results.filter(function(row) { + return row.id == "3" + })[0]; // do an update var doc3 = db.open("3"); doc3.updated = "totally"; doc3 = db.save(doc3); changes = db.changes(); - // the update should make doc id 3 have the last seq num + // the update should make doc id 3 have another seq num (not nec. higher or the last though) T(changes.results.length == 4); var updated_doc = changes.results.filter(function(row) { - return row.id == doc3.id + return row.id == "3" })[0]; - TEquals("3", updated_doc.id, "doc id should be 3"); + T(orig_doc.seq != updated_doc.seq, "seq num should be different"); // ok now lets see what happens with include docs changes = db.changes({include_docs: true}); |