mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:15:07 +00:00
LibJS: Use assertNotReached() in tests
This commit is contained in:
parent
92a9fe0e49
commit
b9415dc0e9
8 changed files with 36 additions and 27 deletions
|
@ -1,11 +1,13 @@
|
|||
try {
|
||||
throw 1;
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(e === 1);
|
||||
}
|
||||
|
||||
try {
|
||||
throw [99];
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(typeof e === "object");
|
||||
assert(e.length === 1);
|
||||
|
@ -13,10 +15,12 @@ try {
|
|||
|
||||
function foo() {
|
||||
throw "hello";
|
||||
assertNotReached();
|
||||
}
|
||||
|
||||
try {
|
||||
foo();
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(e === "hello");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue