mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:15:06 +00:00
LibJS: Convert some top-level tests to the new system
First test conversions! These look really good :)
This commit is contained in:
parent
4b8a3e6d78
commit
eea6041302
22 changed files with 464 additions and 451 deletions
|
@ -1,22 +1,25 @@
|
|||
load("test-common.js")
|
||||
test("regular comments", () => {
|
||||
const source =
|
||||
`var i = 0;
|
||||
|
||||
try {
|
||||
var i = 0;
|
||||
// i++;
|
||||
/* i++; */
|
||||
/*
|
||||
i++;
|
||||
*/
|
||||
return i;`;
|
||||
|
||||
// i++;
|
||||
/* i++; */
|
||||
/*
|
||||
i++;
|
||||
*/
|
||||
<!-- i++; --> i++;
|
||||
<!-- i++;
|
||||
i++;
|
||||
--> i++;
|
||||
expect(source).toEvalTo(0);
|
||||
});
|
||||
|
||||
assert(i === 1);
|
||||
|
||||
console.log('PASS');
|
||||
} catch (e) {
|
||||
console.log('FAIL: ' + e);
|
||||
}
|
||||
test("html comments", () => {
|
||||
const source =
|
||||
`var i = 0;
|
||||
<!-- i++; --> i++;
|
||||
<!-- i++;
|
||||
i++;
|
||||
--> i++;
|
||||
return i;`
|
||||
|
||||
expect(source).toEvalTo(1);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue