Skip to content

Commit

Permalink
Add Then extension to Set
Browse files Browse the repository at this point in the history
  • Loading branch information
devxoul committed Sep 7, 2019
1 parent 87bcf03 commit 894b510
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Then/Then.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
7 changes: 7 additions & 0 deletions Tests/ThenTests/ThenTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 894b510

Please sign in to comment.