Add test for crashing
This commit is contained in:
@@ -61,12 +61,17 @@ class LexerTests: XCTestCase {
|
||||
|
||||
$0.it("can tokenize an unclosed block") {
|
||||
let lexer = Lexer(templateString: "{%}")
|
||||
let _ = lexer.tokenize()
|
||||
_ = lexer.tokenize()
|
||||
}
|
||||
|
||||
$0.it("can tokenize incorrect syntax without crashing") {
|
||||
let lexer = Lexer(templateString: "func some() {{% if %}")
|
||||
_ = lexer.tokenize()
|
||||
}
|
||||
|
||||
$0.it("can tokenize an empty variable") {
|
||||
let lexer = Lexer(templateString: "{{}}")
|
||||
let _ = lexer.tokenize()
|
||||
_ = lexer.tokenize()
|
||||
}
|
||||
|
||||
$0.it("can tokenize with new lines") {
|
||||
@@ -95,3 +100,4 @@ class LexerTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user