Skip to content

Commit

Permalink
fixed tests on swift 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka committed Jan 1, 2018
1 parent 691fe52 commit a6dba67
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Tests/StencilTests/ForNodeSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ func testForNode() {

$0.it("can iterate over dictionary") {
let templateString = "{% for key,value in dict %}" +
"{{ key }}: {{ value }}\n" +
"{% endfor %}\n"
"{{ key }}: {{ value }}," +
"{% endfor %}"

let template = Template(templateString: templateString)
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"]
}

Expand All @@ -148,7 +148,7 @@ func testForNode() {
let node = ForNode(resolvable: Variable("dict"), loopVariables: ["key"], nodes: nodes, emptyNodes: emptyNodes, where: nil)
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"]
}

Expand All @@ -164,7 +164,7 @@ func testForNode() {

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"]
}

Expand Down

0 comments on commit a6dba67

Please sign in to comment.