diff --git a/Package.swift b/Package.swift index 96ea89e..342f058 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.5 import PackageDescription let package = Package( diff --git a/Tests/MockUserDefaultsSwiftTests/MockUserDefaultsSwiftTests.swift b/Tests/MockUserDefaultsSwiftTests/MockUserDefaultsSwiftTests.swift index b7c2b42..6946d6c 100644 --- a/Tests/MockUserDefaultsSwiftTests/MockUserDefaultsSwiftTests.swift +++ b/Tests/MockUserDefaultsSwiftTests/MockUserDefaultsSwiftTests.swift @@ -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") @@ -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") @@ -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) @@ -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) @@ -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) @@ -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) @@ -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)