fixed tests on swift 3.1
This commit is contained in:
@@ -129,13 +129,13 @@ func testForNode() {
|
|||||||
|
|
||||||
$0.it("can iterate over dictionary") {
|
$0.it("can iterate over dictionary") {
|
||||||
let templateString = "{% for key,value in dict %}" +
|
let templateString = "{% for key,value in dict %}" +
|
||||||
"{{ key }}: {{ value }}\n" +
|
"{{ key }}: {{ value }}," +
|
||||||
"{% endfor %}\n"
|
"{% endfor %}"
|
||||||
|
|
||||||
let template = Template(templateString: templateString)
|
let template = Template(templateString: templateString)
|
||||||
let result = try template.render(context)
|
let result = try template.render(context)
|
||||||
|
|
||||||
let sortedResult = result.split(separator: "\n").sorted(by: <)
|
let sortedResult = result.characters.split(separator: ",").map(String.init).sorted(by: <)
|
||||||
try expect(sortedResult) == ["one: I", "two: II"]
|
try expect(sortedResult) == ["one: I", "two: II"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ func testForNode() {
|
|||||||
let node = ForNode(resolvable: Variable("dict"), loopVariables: ["key"], nodes: nodes, emptyNodes: emptyNodes, where: nil)
|
let node = ForNode(resolvable: Variable("dict"), loopVariables: ["key"], nodes: nodes, emptyNodes: emptyNodes, where: nil)
|
||||||
let result = try node.render(context)
|
let result = try node.render(context)
|
||||||
|
|
||||||
let sortedResult = result.split(separator: ",").sorted(by: <)
|
let sortedResult = result.characters.split(separator: ",").map(String.init).sorted(by: <)
|
||||||
try expect(sortedResult) == ["one", "two"]
|
try expect(sortedResult) == ["one", "two"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ func testForNode() {
|
|||||||
|
|
||||||
let result = try node.render(context)
|
let result = try node.render(context)
|
||||||
|
|
||||||
let sortedResult = result.split(separator: ",").sorted(by: <)
|
let sortedResult = result.characters.split(separator: ",").map(String.init).sorted(by: <)
|
||||||
try expect(sortedResult) == ["one=I", "two=II"]
|
try expect(sortedResult) == ["one=I", "two=II"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user