summaryrefslogtreecommitdiff
path: root/share/www/script/couch_test_runner.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/couch_test_runner.js')
-rw-r--r--share/www/script/couch_test_runner.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
index ae357aeb..ae0dc573 100644
--- a/share/www/script/couch_test_runner.js
+++ b/share/www/script/couch_test_runner.js
@@ -152,13 +152,13 @@ function updateTestsFooter() {
// display the line that failed.
// Example:
// T(MyValue==1);
-function T(arg1, arg2) {
+function T(arg1, arg2, testName) {
if (!arg1) {
if (currentRow) {
if ($("td.details ol", currentRow).length == 0) {
$("<ol></ol>").appendTo($("td.details", currentRow));
}
- $("<li><b>Assertion failed:</b> <code class='failure'></code></li>")
+ $("<li><b>Assertion " + (testName ? "'" + testName + "'" : "") + " failed:</b> <code class='failure'></code></li>")
.find("code").text((arg2 != null ? arg2 : arg1).toString()).end()
.appendTo($("td.details ol", currentRow));
}
@@ -166,6 +166,10 @@ function T(arg1, arg2) {
}
}
+function TEquals(expected, actual, testName) {
+ T(equals(expected, actual), "expected '" + expected + "', got '" + actual + "'", testName);
+}
+
function equals(a,b) {
if (a === b) return true;
try {