summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2017-05-14 13:06:47 +0200
committerJan Lehnardt <jan@apache.org>2017-05-14 13:06:47 +0200
commit3fac47cd4d838ba01611598924cb9396c54cbb00 (patch)
tree289e9e94867b41af423df78fd2437c26849e3096
parentdc258cca4445a1205e30386105d7a14b531052af (diff)
downloadcouchdb-3fac47cd4d838ba01611598924cb9396c54cbb00.tar.gz
chore: add dedbugging for failing test COUCHDB-3343
-rw-r--r--test/javascript/couch_test_runner.js9
-rw-r--r--test/javascript/tests/show_documents.js4
2 files changed, 11 insertions, 2 deletions
diff --git a/test/javascript/couch_test_runner.js b/test/javascript/couch_test_runner.js
index 421abd2db..53593c361 100644
--- a/test/javascript/couch_test_runner.js
+++ b/test/javascript/couch_test_runner.js
@@ -321,6 +321,11 @@ function TEquals(expected, actual, testName) {
"', got '" + repr(actual) + "'", testName);
}
+function TNotEquals(expected, actual, testName) {
+ T(notEquals(expected, actual), "expected '" + repr(expected) +
+ "', got '" + repr(actual) + "'", testName);
+}
+
function TEqualsIgnoreCase(expected, actual, testName) {
T(equals(expected.toUpperCase(), actual.toUpperCase()), "expected '" + repr(expected) +
"', got '" + repr(actual) + "'", testName);
@@ -335,6 +340,10 @@ function equals(a,b) {
}
}
+function notEquals(a,b) {
+ if (a != b) return true;
+}
+
function repr(val) {
if (val === undefined) {
return null;
diff --git a/test/javascript/tests/show_documents.js b/test/javascript/tests/show_documents.js
index ca7563726..50cb848e4 100644
--- a/test/javascript/tests/show_documents.js
+++ b/test/javascript/tests/show_documents.js
@@ -202,7 +202,7 @@ couchTests.show_documents = function(debug) {
T(xhr.status == 404);
var resp = JSON.parse(xhr.responseText);
T(resp.error == "not_found");
-
+
// show with doc
xhr = CouchDB.request("GET", "/" + db_name + "/_design/template/_show/just-name/"+docid);
T(xhr.responseText == "Just Rusty");
@@ -293,7 +293,7 @@ couchTests.show_documents = function(debug) {
headers: {"if-none-match": etag}
});
// should not be 304 if we change the doc
- T(xhr.status != 304, "changed ddoc");
+ TNotEquals(304, xhr.status, "changed ddoc");
// update design doc function
designDoc.shows["just-name"] = stringFun(function(doc, req) {