syntax error on empty variable tag

This commit is contained in:
Ilya Puchka
2019-01-12 22:10:21 +00:00
parent 0f18d43d9e
commit 693565ddda
4 changed files with 15 additions and 3 deletions

View File

@@ -133,6 +133,11 @@ final class EnvironmentTests: XCTestCase {
token: "name|unknown"
)
}
it("reports error in variable tag") {
self.template = "{{ }}"
try self.expectError(reason: "Missing variable name", token: " ")
}
}
func testRenderingError() {
@@ -153,7 +158,7 @@ final class EnvironmentTests: XCTestCase {
it("reports passing argument to simple filter") {
self.template = "{{ name|uppercase:5 }}"
try self.expectError(reason: "cannot invoke filter with an argument", token: "name|uppercase:5")
try self.expectError(reason: "Can't invoke filter with an argument", token: "name|uppercase:5")
}
it("reports rendering error in custom tag") {