Skip to content

Commit

Permalink
Add tests for generic dictionary operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian King committed Dec 15, 2016
1 parent 6166791 commit 5d5fc16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MarshalTests/MarshalTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ class MarshalTests: XCTestCase {
"huge": Int.max,
"decimal": 1.2,
"array": [ "a", "b", "c" ],
"boolDictionary": [ "a": true, "b": false, "c": true ],
"nested": [
"key": "value"
]
Expand All @@ -414,6 +415,8 @@ class MarshalTests: XCTestCase {
let huge: Int = try result <| "huge"
let decimal: Float = try result <| "decimal"
let array: [String] = try result <| "array"
let boolDictionary: [String: Bool] = try result <| "boolDictionary"
let optBoolDictionary: [String: Bool]? = try result <| "boolDictionary"
let nested: [String:Any] = try result <| "nested"

XCTAssertEqual(string, "A String")
Expand All @@ -426,6 +429,8 @@ class MarshalTests: XCTestCase {
XCTAssertEqual(decimal, 1.2)
XCTAssertEqual(array, [ "a", "b", "c" ])
XCTAssertEqual(nested as! [String:String], [ "key": "value" ])
XCTAssertEqual(boolDictionary, [ "a": true, "b": false, "c": true ])
XCTAssertEqual(boolDictionary, optBoolDictionary ?? [:])
} catch {
XCTFail("Error converting MarshalDictionary: \(error)")
}
Expand Down

0 comments on commit 5d5fc16

Please sign in to comment.