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-20 14:10:43 +0200
commitdd524b16b0d249579156682eebfd35bc96aa3f78 (patch)
treef210a405e9bedbcf76dc6396b9929068f05a3f9f
parentaca6a459e454aa684cb864901899a3320a0c2480 (diff)
downloadcouchdb-dd524b16b0d249579156682eebfd35bc96aa3f78.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) {