Compiler exceptions
This commit is contained in:
@@ -11,7 +11,8 @@ uses
|
||||
Myc.Ast.Script,
|
||||
Myc.Ast.Environment,
|
||||
Myc.Data.Value,
|
||||
Myc.Data.Scalar;
|
||||
Myc.Data.Scalar,
|
||||
Myc.Ast.Compiler.Macros;
|
||||
|
||||
type
|
||||
[TestFixture]
|
||||
@@ -239,12 +240,12 @@ end;
|
||||
|
||||
procedure TMacroTests.Test_Error_Unquote_Outside_Quasiquote;
|
||||
begin
|
||||
Assert.WillRaise(procedure begin Run('(print ~1)'); end, Exception, 'Unquote outside quasiquote should raise exception');
|
||||
Assert.WillRaise(procedure begin Run('(print ~1)'); end, EMacroException, 'Unquote outside quasiquote should raise exception');
|
||||
end;
|
||||
|
||||
procedure TMacroTests.Test_Macro_Argument_Count_Mismatch;
|
||||
begin
|
||||
Assert.WillRaise(procedure begin Run('(do (defmacro two [a b] `(+ ~a ~b)) (two 1))'); end, Exception);
|
||||
Assert.WillRaise(procedure begin Run('(do (defmacro two [a b] `(+ ~a ~b)) (two 1))'); end, EMacroException);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@@ -355,7 +355,6 @@ end;
|
||||
|
||||
procedure TTestMycAstScript.Parser_Error_UnbalancedParens_MissingRight;
|
||||
begin
|
||||
// FIX 2: Pass explicit Exception type to WillRaise
|
||||
Assert.WillRaise(procedure begin Parse('(a b'); end, EParserException);
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user