Adds test infrastructure for JS optimizer. Adds simple tests

This commit is contained in:
Alexey Andreev
2016-03-22 13:30:11 +03:00
parent a7fcbb614d
commit af7ddb4572
21 changed files with 473 additions and 2 deletions
@@ -0,0 +1,20 @@
function test(n) {
var result;
if (n >= 0) {
result = n;
}
else {
result = -n;
}
return result;
}
function box() {
var result = test(20)
if (result != 20) return "fail1: " + result;
result = test(-20)
if (result != 20) return "fail2: " + result;
return "OK"
}