mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 877178 - Add an exception checking method to SimpleTest, r=robcee
This commit is contained in:
parent
37eed26117
commit
397e911113
@ -260,6 +260,17 @@ SimpleTest.ise = function (a, b, name) {
|
||||
SimpleTest.ok(pass, name, diag);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check that the function call throws an exception.
|
||||
*/
|
||||
SimpleTest.doesThrow = function(fn, name) {
|
||||
var gotException = false;
|
||||
try {
|
||||
fn();
|
||||
} catch (ex) { gotException = true; }
|
||||
ok(gotException, name);
|
||||
};
|
||||
|
||||
// --------------- Test.Builder/Test.More todo() -----------------
|
||||
|
||||
SimpleTest.todo = function(condition, name, diag) {
|
||||
|
Loading…
Reference in New Issue
Block a user