Skip to content

Commit

Permalink
Merge pull request #52 from 417-72KI/require-swift-5.5
Browse files Browse the repository at this point in the history
Drop Swift 5.3 and 5.4 support
  • Loading branch information
417-72KI authored Sep 16, 2023
2 parents fb4d481 + b17a078 commit 0e0a6c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.5
import PackageDescription

let package = Package(
Expand Down
26 changes: 13 additions & 13 deletions Tests/MockUserDefaultsSwiftTests/MockUserDefaultsSwiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MockUserDefaultsSwiftTests: XCTestCase {
}

func testObject() {
// XCTAssertNil(userDefaults.object(forKey: testKey))
XCTAssertNil(userDefaults.object(forKey: testKey))

userDefaults.set("string", forKey: testKey)
XCTAssertEqual(userDefaults.object(forKey: testKey) as? String, "string")
Expand All @@ -45,7 +45,7 @@ class MockUserDefaultsSwiftTests: XCTestCase {
}

func testString() {
// XCTAssertNil(userDefaults.string(forKey: testKey))
XCTAssertNil(userDefaults.string(forKey: testKey))

userDefaults.set("string", forKey: testKey)
XCTAssertEqual(userDefaults.string(forKey: testKey), "string")
Expand Down Expand Up @@ -86,12 +86,12 @@ class MockUserDefaultsSwiftTests: XCTestCase {
}

func testArray() {
// XCTAssertNil(userDefaults.array(forKey: testKey))
XCTAssertNil(userDefaults.array(forKey: testKey))

userDefaults.set([], forKey: testKey)
userDefaults.set([] as [Any], forKey: testKey)
XCTAssertEqual(userDefaults.array(forKey: testKey)?.isEmpty, true)

userDefaults.set(["string", 10], forKey:testKey)
userDefaults.set(["string", 10] as [Any], forKey:testKey)
XCTAssertEqual(userDefaults.array(forKey: testKey)?.count, 2)
XCTAssertEqual(userDefaults.array(forKey: testKey)?[0] as? String, "string")
XCTAssertEqual(userDefaults.array(forKey: testKey)?[1] as? Int, 10)
Expand All @@ -101,12 +101,12 @@ class MockUserDefaultsSwiftTests: XCTestCase {
}

func testDictionary() {
// XCTAssertNil(userDefaults.dictionary(forKey: testKey))
XCTAssertNil(userDefaults.dictionary(forKey: testKey))

userDefaults.set([:], forKey:testKey)
userDefaults.set([:] as [AnyHashable: Any], forKey:testKey)
XCTAssertEqual(userDefaults.dictionary(forKey: testKey)?.isEmpty, true)

userDefaults.set(["string": "string", "int" : 10], forKey:testKey)
userDefaults.set(["string": "string", "int" : 10] as [AnyHashable: Any], forKey:testKey)
XCTAssertEqual(userDefaults.dictionary(forKey: testKey)?.count, 2)
XCTAssertEqual(userDefaults.dictionary(forKey: testKey)?["string"] as? String, "string")
XCTAssertEqual(userDefaults.dictionary(forKey: testKey)?["int"] as? Int, 10)
Expand All @@ -116,15 +116,15 @@ class MockUserDefaultsSwiftTests: XCTestCase {
}

func testStringArray() {
// XCTAssertNil(userDefaults.stringArray(forKey: testKey))
XCTAssertNil(userDefaults.stringArray(forKey: testKey))

userDefaults.set([], forKey: testKey)
userDefaults.set([] as [Any], forKey: testKey)
XCTAssertEqual(userDefaults.stringArray(forKey: testKey), [])

userDefaults.set(["string"], forKey:testKey)
XCTAssertEqual(userDefaults.stringArray(forKey: testKey), ["string"])

userDefaults.set(["string", 10], forKey:testKey)
userDefaults.set(["string", 10] as [Any], forKey:testKey)
XCTAssertNil(userDefaults.stringArray(forKey: testKey))

userDefaults.set("not an array", forKey: testKey)
Expand All @@ -137,7 +137,7 @@ class MockUserDefaultsSwiftTests: XCTestCase {
return Data(base64Encoded: base64, options: .ignoreUnknownCharacters)
}

// XCTAssertNil(userDefaults.data(forKey: testKey))
XCTAssertNil(userDefaults.data(forKey: testKey))

let data = createData()
XCTAssertNotNil(data)
Expand All @@ -149,7 +149,7 @@ class MockUserDefaultsSwiftTests: XCTestCase {
}

func testUrl() {
// XCTAssertNil(userDefaults.url(forKey: testKey))
XCTAssertNil(userDefaults.url(forKey: testKey))

let url = URL(string: "https://github.com/")
XCTAssertNotNil(url)
Expand Down

0 comments on commit 0e0a6c8

Please sign in to comment.