blob: ed8fef09005d73ded1b0aa5ac9e7ac267ca31bcf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
describe "try/catch", ->
it "catch and rethrow", ->
ok, success, err = pcall ->
try
error "boom"
catch e
_, result = try
error "wrap:" .. e\match "^.-:%d+:%s*(.*)$"
result
assert.same ok, true
assert.same success, false
assert.is_true err\match("wrap:boom") != nil
|