aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/test/try_catch_spec.yue
blob: 7447886334ee1462651f02b1e0806f20e6e9d33f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
describe "try/catch", ->
	it "catch and rethrow", ->
		import global
		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