Fix issue with indented partials (#19)
* Fix issue with indented partials * Add test * Add empty transform for string
This commit is contained in:
@@ -82,7 +82,7 @@ final class TemplateRendererTests: XCTestCase {
|
||||
XCTAssertEqual(template.render(Test(string: nil)), "test ")
|
||||
}
|
||||
|
||||
func testOptionalSequence() throws {
|
||||
func testOptionalSection() throws {
|
||||
struct Test {
|
||||
let string: String?
|
||||
}
|
||||
@@ -94,6 +94,22 @@ final class TemplateRendererTests: XCTestCase {
|
||||
XCTAssertEqual(template2.render(Test(string: nil)), "test *")
|
||||
}
|
||||
|
||||
func testOptionalSequence() throws {
|
||||
struct Test {
|
||||
let string: String?
|
||||
}
|
||||
let template = try HBMustacheTemplate(string: "test {{#.}}{{string}}{{/.}}")
|
||||
XCTAssertEqual(template.render([Test(string: "string")]), "test string")
|
||||
}
|
||||
|
||||
func testOptionalSequenceSection() throws {
|
||||
struct Test {
|
||||
let string: String?
|
||||
}
|
||||
let template = try HBMustacheTemplate(string: "test {{#.}}{{#string}}*{{.}}{{/string}}{{/.}}")
|
||||
XCTAssertEqual(template.render([Test(string: "string")]), "test *string")
|
||||
}
|
||||
|
||||
func testStructureInStructure() throws {
|
||||
struct SubTest {
|
||||
let string: String?
|
||||
|
||||
Reference in New Issue
Block a user