Skip to content

Commit 71760a5

Browse files
committed
Don't use assert() in browser.test_modularize test, which is not visible in all test code. Fixes a noisy 'assert is undefined' print during the test.
1 parent 559ac73 commit 71760a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/browser_test_hello_world.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ int main() {
1515
});
1616
printf("hello, world!\n");
1717
EM_ASM({
18-
assert(Module.prints.length === 1, 'bad length');
19-
assert(Module.prints[0] == 'hello, world!', 'bad contents: ' + Module.prints[0]);
18+
if (Module.prints.length !== 1) throw 'bad length ' + Module.prints.length;
19+
if (Module.prints[0] !== 'hello, world!') throw 'bad contents: ' + Module.prints[0];
2020
});
2121
REPORT_RESULT(0);
2222
return 0;

tests/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,7 @@ def test_modularize(self):
29382938
var helloOutside = HelloWorld({ noInitialRun: true }).then(function(hello) {
29392939
setTimeout(function() {
29402940
hello._main();
2941-
assert(hello === helloOutside); // as we are async, helloOutside must have been set
2941+
if (hello !== helloOutside) throw 'helloOutside has not been set!'; // as we are async, helloOutside must have been set
29422942
});
29432943
});
29442944
'''),

0 commit comments

Comments
 (0)