Compare commits
8 Commits
pitweb
...
31d67f6710
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31d67f6710 | ||
|
|
836227c8d3 | ||
|
|
8e2607b6ca | ||
|
|
dc73e86d8c | ||
|
|
555cceb9d6 | ||
|
|
fbb7933eb6 | ||
|
|
0287d6ada4 | ||
|
|
73cd6a255d |
1175
source/quickjs.c
1175
source/quickjs.c
File diff suppressed because it is too large
Load Diff
26
vm_suite.ce
26
vm_suite.ce
@@ -4,27 +4,33 @@
|
||||
|
||||
var passed = 0
|
||||
var failed = 0
|
||||
var errors = []
|
||||
var error_names = []
|
||||
var error_reasons = []
|
||||
var fail_msg = ""
|
||||
|
||||
// pre-allocate 500 slots to avoid array growth during disruption handlers
|
||||
for (var _i = 0; _i < 500; _i++) {
|
||||
error_names[] = null
|
||||
error_reasons[] = null
|
||||
}
|
||||
|
||||
var fail = function(msg) {
|
||||
fail_msg = msg
|
||||
print("failed: " + msg)
|
||||
disrupt
|
||||
}
|
||||
|
||||
var assert_eq = function(actual, expected, msg) {
|
||||
if (actual != expected) fail(msg + " (expected=" + text(expected) + " got=" + text(actual) + ")")
|
||||
if (actual != expected) fail(msg + " (got=" + text(actual) + ")")
|
||||
}
|
||||
|
||||
var run = function(name, fn) {
|
||||
fail_msg = ""
|
||||
fn()
|
||||
passed = passed + 1
|
||||
print("passed " + name)
|
||||
} disruption {
|
||||
error_names[failed] = name
|
||||
error_reasons[failed] = fail_msg == "" ? "disruption" : fail_msg
|
||||
failed = failed + 1
|
||||
errors[] = name
|
||||
}
|
||||
|
||||
var should_disrupt = function(fn) {
|
||||
@@ -3367,10 +3373,10 @@ run("gc object from keys function under pressure", function() {
|
||||
// SUMMARY
|
||||
// ============================================================================
|
||||
|
||||
print(`\nResults: ${passed} passed, ${failed} failed out of ${passed + failed}`)
|
||||
print(text(passed) + " passed, " + text(failed) + " failed out of " + text(passed + failed))
|
||||
if (failed > 0) {
|
||||
print("Failed tests:")
|
||||
arrfor(errors, function(name) {
|
||||
print(` - ${name}`)
|
||||
})
|
||||
print("")
|
||||
for (var _j = 0; _j < failed; _j++) {
|
||||
print(" FAIL " + error_names[_j] + ": " + error_reasons[_j])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user