letThrow as a convenient way to debug a try-catch expression
This commit is contained in:
@@ -293,6 +293,10 @@ class BasicTestCase extends Test {
|
||||
function testVoid() {
|
||||
_testVoid();
|
||||
}
|
||||
|
||||
function testLetThrow() {
|
||||
_testLetThrow();
|
||||
}
|
||||
}
|
||||
|
||||
class BasicObject {
|
||||
|
@@ -495,4 +495,14 @@
|
||||
(defun :Void myVoid [] (set voidRan true))
|
||||
(defun _testVoid []
|
||||
(myVoid)
|
||||
(Assert.isTrue voidRan))
|
||||
(Assert.isTrue voidRan))
|
||||
|
||||
(defun _testLetThrow []
|
||||
(try
|
||||
{
|
||||
(letThrow
|
||||
(throw "the error we want")
|
||||
(catch [e] (Assert.fail)))
|
||||
(Assert.fail)}
|
||||
(catch [:String e]
|
||||
(Assert.equals "the error we want" e))))
|
Reference in New Issue
Block a user