Tests for Parser
This commit is contained in:
@@ -356,27 +356,27 @@ end;
|
||||
procedure TTestMycAstScript.Parser_Error_UnbalancedParens_MissingRight;
|
||||
begin
|
||||
// FIX 2: Pass explicit Exception type to WillRaise
|
||||
Assert.WillRaise(procedure begin Parse('(a b'); end, Exception);
|
||||
Assert.WillRaise(procedure begin Parse('(a b'); end, EParserException);
|
||||
end;
|
||||
|
||||
procedure TTestMycAstScript.Parser_Error_UnbalancedParens_ExtraRight;
|
||||
begin
|
||||
Assert.WillRaise(procedure begin Parse('a )'); end, Exception);
|
||||
Assert.WillRaise(procedure begin Parse('a )'); end, EParserException);
|
||||
end;
|
||||
|
||||
procedure TTestMycAstScript.Parser_Error_UnterminatedString;
|
||||
begin
|
||||
Assert.WillRaise(procedure begin Parse('"hello'); end, Exception);
|
||||
Assert.WillRaise(procedure begin Parse('"hello'); end, EParserException);
|
||||
end;
|
||||
|
||||
procedure TTestMycAstScript.Parser_Error_EmptyList;
|
||||
begin
|
||||
Assert.WillRaise(procedure begin Parse('()'); end, Exception);
|
||||
Assert.WillRaise(procedure begin Parse('()'); end, EParserException);
|
||||
end;
|
||||
|
||||
procedure TTestMycAstScript.Parser_Error_Record_MissingValue;
|
||||
begin
|
||||
Assert.WillRaise(procedure begin Parse('{:a 1 :b}'); end, Exception);
|
||||
Assert.WillRaise(procedure begin Parse('{:a 1 :b}'); end, EParserException);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user