mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 578301 - Clearly identify expected and actual results when tests fail. r=dbaron
This commit is contained in:
parent
1bd914f84a
commit
10e54c1b6b
@ -55,12 +55,18 @@ SimpleTest.ok = function (condition, name, diag) {
|
||||
**/
|
||||
SimpleTest.is = function (a, b, name) {
|
||||
var repr = MochiKit.Base.repr;
|
||||
SimpleTest.ok(a == b, name, repr(a) + " should equal " + repr(b));
|
||||
var pass = (a == b);
|
||||
var diag = pass ? repr(a) + " should equal " + repr(b)
|
||||
: "got " + repr(a) + ", expected " + repr(b)
|
||||
SimpleTest.ok(pass, name, diag);
|
||||
};
|
||||
|
||||
SimpleTest.isnot = function (a, b, name) {
|
||||
var repr = MochiKit.Base.repr;
|
||||
SimpleTest.ok(a != b, name, repr(a) + " should not equal " + repr(b));
|
||||
var pass = (a != b);
|
||||
var diag = pass ? repr(a) + " should not equal " + repr(b)
|
||||
: "didn't expect " + repr(a) + ", but got it";
|
||||
SimpleTest.ok(pass, name, diag);
|
||||
};
|
||||
|
||||
// --------------- Test.Builder/Test.More todo() -----------------
|
||||
@ -99,12 +105,18 @@ SimpleTest._logResult = function(test, passString, failString) {
|
||||
|
||||
SimpleTest.todo_is = function (a, b, name) {
|
||||
var repr = MochiKit.Base.repr;
|
||||
SimpleTest.todo(a == b, name, repr(a) + " should equal " + repr(b));
|
||||
var pass = (a == b);
|
||||
var diag = pass ? repr(a) + " should equal " + repr(b)
|
||||
: "got " + repr(a) + ", expected " + repr(b);
|
||||
SimpleTest.todo(pass, name, diag);
|
||||
};
|
||||
|
||||
SimpleTest.todo_isnot = function (a, b, name) {
|
||||
var repr = MochiKit.Base.repr;
|
||||
SimpleTest.todo(a != b, name, repr(a) + " should not equal " + repr(b));
|
||||
var pass = (a != b);
|
||||
var diag = pass ? repr(a) + " should not equal " + repr(b)
|
||||
: "didn't expect " + repr(a) + ", but got it";
|
||||
SimpleTest.todo(pass, name, diag);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user