Skip to content

Commit

Permalink
Parameters.flatten: Add assertion to ensure order of arrays is preserved
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed Oct 10, 2017
1 parent a50611b commit ed65f47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Filters+Numbers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extension Filters {
enum Numbers {
static func hexToInt(_ value: Any?) throws -> Any? {
guard let value = value as? String else { throw Filters.Error.invalidInputType }
return Int(value, radix: 16)
return Int(value, radix: 16)
}

static func int255toFloat(_ value: Any?) throws -> Any? {
Expand Down
2 changes: 1 addition & 1 deletion Tests/StencilSwiftKitTests/ContextTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ContextTests: XCTestCase {
}

func testWithContext() throws {
let context: [String : Any] = ["foo": "bar", "hello": true]
let context: [String: Any] = ["foo": "bar", "hello": true]

let result = try StencilContext.enrich(context: context,
parameters: [],
Expand Down
2 changes: 2 additions & 0 deletions Tests/StencilSwiftKitTests/ParametersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class ParametersTests: XCTestCase {
"Flattening the resulting dictionary back did not result in the equivalent of the original list")
XCTAssertEqual(Set(reverse), Set(items),
"Flattening the resulting dictionary back did not result in the equivalent of the original list")
XCTAssertEqual(reverse, items,
"The order of arrays are properly preserved when flattened")
}

func testParseInvalidSyntax() {
Expand Down

0 comments on commit ed65f47

Please sign in to comment.