diff --git a/Sources/Then/Then.swift b/Sources/Then/Then.swift index 3b91b74..741d265 100644 --- a/Sources/Then/Then.swift +++ b/Sources/Then/Then.swift @@ -79,6 +79,7 @@ extension CGSize: Then {} extension CGVector: Then {} extension Array: Then {} extension Dictionary: Then {} +extension Set: Then {} #if os(iOS) || os(tvOS) extension UIEdgeInsets: Then {} diff --git a/Tests/ThenTests/ThenTests.swift b/Tests/ThenTests/ThenTests.swift index eefa31a..4cecef1 100644 --- a/Tests/ThenTests/ThenTests.swift +++ b/Tests/ThenTests/ThenTests.swift @@ -47,6 +47,13 @@ class ThenTests: XCTestCase { XCTAssertEqual(dict, ["Korea": "Seoul", "Japan": "Tokyo", "China": "Beijing"]) } + func testWith_Set() { + let set = Set(["A", "B", "C"]).with { + $0.insert("D") + } + XCTAssertEqual(set, Set(["A", "B", "C", "D"])) + } + func testDo() { UserDefaults.standard.do { $0.removeObject(forKey: "username")