throwCompileError in expBuilder
This commit is contained in:
@@ -46,6 +46,10 @@ class MacroTestCase extends Test {
|
||||
_testSetMacroVar();
|
||||
}
|
||||
|
||||
function testRedefineMacroVar() {
|
||||
_testRedefineMacroVar();
|
||||
}
|
||||
|
||||
function testTryCatchWithoutDynamic () {
|
||||
_testTryCatchWithoutDynamic();
|
||||
}
|
||||
|
@@ -60,6 +60,7 @@
|
||||
(_testPrintAtMacroTimeMacro)
|
||||
(Assert.pass))
|
||||
|
||||
// Calling (set) on a macroVar is a faux-pas, but calling defMacroVar again is not
|
||||
(defMacroVar count 0)
|
||||
(defMacro _testSetMacroVarMacro []
|
||||
(assertThrows (set count (+ count 1)))
|
||||
@@ -69,6 +70,15 @@
|
||||
(_testSetMacroVarMacro)
|
||||
(Assert.pass))
|
||||
|
||||
(defMacro _testRedefineMacroVarMacro []
|
||||
(defMacroVar count (+ count 1))
|
||||
(symbol (Std.string count)))
|
||||
|
||||
(function _testRedefineMacroVar []
|
||||
(Assert.equals 1 (_testRedefineMacroVarMacro))
|
||||
(Assert.equals 2 (_testRedefineMacroVarMacro)))
|
||||
|
||||
|
||||
// ifLet and its derivatives should be disabled in defMacro bodies:
|
||||
(defMacro _testIfLetDisabledMacro []
|
||||
(assertThrows (ifLet [a "b"] a))
|
||||
|
Reference in New Issue
Block a user