mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:18:12 +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,6 +1,7 @@
|
|||
try {
|
||||
try {
|
||||
Math.abs(-20) = 40;
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(e.name === "ReferenceError");
|
||||
assert(e.message === "Invalid left-hand side in assignment");
|
||||
|
@ -8,6 +9,7 @@ try {
|
|||
|
||||
try {
|
||||
512 = 256;
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(e.name === "ReferenceError");
|
||||
assert(e.message === "Invalid left-hand side in assignment");
|
||||
|
@ -15,6 +17,7 @@ try {
|
|||
|
||||
try {
|
||||
"hello world" = "another thing?";
|
||||
assertNotReached();
|
||||
} catch (e) {
|
||||
assert(e.name === "ReferenceError");
|
||||
assert(e.message === "Invalid left-hand side in assignment");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue