Add methods for Array and Dictionary

This commit is contained in:
Adam Fowler
2021-03-12 17:37:25 +00:00
parent c9e33153f3
commit 8df4e63432
7 changed files with 163 additions and 50 deletions

View File

@@ -192,20 +192,6 @@ final class TemplateRendererTests: XCTestCase {
""")
}
func testLowercased() throws {
let template = try HBMustacheTemplate(string: """
{{#repo}}
<b>{{ lowercased(name) }}</b>
{{/repo}}
""")
let object: [String: Any] = ["repo": [["name": "Resque"], ["name": "Hub"], ["name": "RIP"]]]
XCTAssertEqual(template.render(object), """
<b>resque</b>
<b>hub</b>
<b>rip</b>
""")
}
func testPerformance() throws {
let template = try HBMustacheTemplate(string: """
{{#repo}}