rm print
This commit is contained in:
@@ -6,7 +6,7 @@ $start(function(event) {
|
||||
// child started, wait for it to die from memory abuse
|
||||
}
|
||||
if (event.type == 'disrupt') {
|
||||
print("PASS: memory abusing actor killed")
|
||||
log.test("PASS: memory abusing actor killed")
|
||||
$stop()
|
||||
}
|
||||
}, 'tests/hang_actor_memory')
|
||||
|
||||
@@ -7,7 +7,7 @@ $start(function(event) {
|
||||
}
|
||||
if (event.type == 'disrupt') {
|
||||
// child was killed by the timer — success
|
||||
print("PASS: slow actor killed by timer")
|
||||
log.test("PASS: slow actor killed by timer")
|
||||
$stop()
|
||||
}
|
||||
}, 'tests/hang_actor')
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// completing the computation correctly.
|
||||
$receiver(function(msg) {
|
||||
if (msg.sum == 12499997500000) {
|
||||
print("PASS: actor suspended and resumed correctly")
|
||||
log.test("PASS: actor suspended and resumed correctly")
|
||||
} else {
|
||||
print(`FAIL: expected 12499997500000, got ${msg.sum}`)
|
||||
log.error(`FAIL: expected 12499997500000, got ${msg.sum}`)
|
||||
}
|
||||
$stop()
|
||||
})
|
||||
@@ -14,7 +14,7 @@ $start(function(event) {
|
||||
send(event.actor, {count: 5000000, reply: $self})
|
||||
}
|
||||
if (event.type == 'disrupt') {
|
||||
print("FAIL: actor was killed instead of completing")
|
||||
log.error("FAIL: actor was killed instead of completing")
|
||||
$stop()
|
||||
}
|
||||
}, 'tests/slow_compute_actor')
|
||||
|
||||
@@ -155,12 +155,12 @@ run("valid var in function body", function() {
|
||||
|
||||
// === SUMMARY ===
|
||||
|
||||
print(text(passed) + " passed, " + text(failed) + " failed out of " + text(passed + failed))
|
||||
log.test(text(passed) + " passed, " + text(failed) + " failed out of " + text(passed + failed))
|
||||
var _j = 0
|
||||
if (failed > 0) {
|
||||
print("")
|
||||
log.test("")
|
||||
for (_j = 0; _j < failed; _j++) {
|
||||
print(" FAIL " + error_names[_j] + ": " + error_reasons[_j])
|
||||
log.error(" FAIL " + error_names[_j] + ": " + error_reasons[_j])
|
||||
}
|
||||
}
|
||||
$stop()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function safe_add(a, b) {
|
||||
return a + b
|
||||
} disruption {
|
||||
print("disruption caught in safe_add")
|
||||
log.test("disruption caught in safe_add")
|
||||
}
|
||||
|
||||
function inner() {
|
||||
@@ -11,19 +11,19 @@ function inner() {
|
||||
function outer() {
|
||||
inner()
|
||||
} disruption {
|
||||
print("disruption caught in outer — from inner()")
|
||||
log.test("disruption caught in outer — from inner()")
|
||||
}
|
||||
|
||||
// Test 1: explicit disrupt with handler
|
||||
function test_explicit() {
|
||||
disrupt
|
||||
} disruption {
|
||||
print("test 1: explicit disrupt handled")
|
||||
log.test("test 1: explicit disrupt handled")
|
||||
}
|
||||
test_explicit()
|
||||
|
||||
// Test 2: type error disrupt (number + function)
|
||||
safe_add(1, print)
|
||||
safe_add(1, is_number)
|
||||
|
||||
// Test 3: unwinding — inner disrupts, outer catches
|
||||
outer()
|
||||
@@ -32,9 +32,9 @@ outer()
|
||||
function test_nested() {
|
||||
disrupt
|
||||
} disruption {
|
||||
print("test 4: first disruption")
|
||||
log.test("test 4: first disruption")
|
||||
}
|
||||
test_nested()
|
||||
|
||||
print("done")
|
||||
log.test("done")
|
||||
$stop()
|
||||
|
||||
Reference in New Issue
Block a user