diff --git a/App/DevKeychain.xcodeproj/project.pbxproj b/App/DevKeychain.xcodeproj/project.pbxproj index 79c8bc2..965ace1 100644 --- a/App/DevKeychain.xcodeproj/project.pbxproj +++ b/App/DevKeychain.xcodeproj/project.pbxproj @@ -180,7 +180,7 @@ }; }; }; - buildConfigurationList = 4C135EBE2E088223008CE477 /* Build configuration list for PBXProject "DevKeychainApp" */; + buildConfigurationList = 4C135EBE2E088223008CE477 /* Build configuration list for PBXProject "DevKeychain" */; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -487,7 +487,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 4C135EBE2E088223008CE477 /* Build configuration list for PBXProject "DevKeychainApp" */ = { + 4C135EBE2E088223008CE477 /* Build configuration list for PBXProject "DevKeychain" */ = { isa = XCConfigurationList; buildConfigurations = ( 4C135EE32E088224008CE477 /* Debug */, @@ -530,7 +530,7 @@ requirement = { kind = versionRange; maximumVersion = 2.0.0; - minimumVersion = "1.0.0-beta.8"; + minimumVersion = "1.0.0-beta.9"; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/App/DevKeychain.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/App/DevKeychain.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 38c7454..fc94e58 100644 --- a/App/DevKeychain.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/App/DevKeychain.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "63ccf8133c2463302e28eb26b3904259b35862fedd8f552a9c15132753ecdc7a", + "originHash" : "0e086ed465efd8ddf1d134e5d85430f563fa91a8e9ae4e0aeccf1019ec3d7178", "pins" : [ { "identity" : "devtesting", "kind" : "remoteSourceControl", "location" : "https://github.com/Devkitorganization/devtesting", "state" : { - "revision" : "c9e9adb688fefaa711b4ef20b83a1855e71108bd", - "version" : "1.0.0-beta.8" + "revision" : "efc47196b864138aebcd0bf68e3df0eb384ebdf0", + "version" : "1.0.0-beta.9" } } ], diff --git a/App/Tests/DevKeychainAppTests/GenericPasswordIntegrationTests.swift b/App/Tests/DevKeychainAppTests/GenericPasswordIntegrationTests.swift index dcbb267..4e35e3e 100644 --- a/App/Tests/DevKeychainAppTests/GenericPasswordIntegrationTests.swift +++ b/App/Tests/DevKeychainAppTests/GenericPasswordIntegrationTests.swift @@ -19,7 +19,7 @@ struct GenericPasswordIntegrationTests: RandomValueGenerating { mutating func addQueryAndDeleteItems() throws { let service = randomAlphanumericString(count: 64) let accounts = Array( - Set(count: random(Int.self, in: 3 ... 5)) { + Set(count: randomInt(in: 3 ... 5)) { randomAlphanumericString() } ) diff --git a/App/Tests/DevKeychainAppTests/InternetPasswordIntegrationTests.swift b/App/Tests/DevKeychainAppTests/InternetPasswordIntegrationTests.swift index 9b27ead..1afc226 100644 --- a/App/Tests/DevKeychainAppTests/InternetPasswordIntegrationTests.swift +++ b/App/Tests/DevKeychainAppTests/InternetPasswordIntegrationTests.swift @@ -19,7 +19,7 @@ struct InternetPasswordIntegrationTests: RandomValueGenerating { mutating func addQueryAndDeleteItems() throws { let server = randomAlphanumericString(count: 64) let accounts = Array( - Set(count: random(Int.self, in: 3 ... 5)) { + Set(count: randomInt(in: 3 ... 5)) { randomAlphanumericString() } ) diff --git a/App/Tests/DevKeychainAppTests/StandardKeychainServicesTests.swift b/App/Tests/DevKeychainAppTests/StandardKeychainServicesTests.swift index e6a4f23..ab140ab 100644 --- a/App/Tests/DevKeychainAppTests/StandardKeychainServicesTests.swift +++ b/App/Tests/DevKeychainAppTests/StandardKeychainServicesTests.swift @@ -19,7 +19,7 @@ struct StandardKeychainServicesTests: RandomValueGenerating { mutating func addQueryAndDeleteItemsSucceeds() throws { let service = randomAlphanumericString(count: 64) let accounts = Array( - Set(count: random(Int.self, in: 3 ... 5)) { + Set(count: randomInt(in: 3 ... 5)) { randomAlphanumericString() } ) diff --git a/Package.resolved b/Package.resolved index 6f7d819..e7af888 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "4620bd1df6ed589595fd875d49e992170bd5d48221f4e284a178f80f4ef8e2ac", + "originHash" : "a5a7527ba3f4e5500840e649cb257ddecf8e3f8c5214dc788684ff243ba5d717", "pins" : [ { "identity" : "devtesting", "kind" : "remoteSourceControl", "location" : "https://github.com/DevKitOrganization/DevTesting", "state" : { - "revision" : "c9e9adb688fefaa711b4ef20b83a1855e71108bd", - "version" : "1.0.0-beta.8" + "revision" : "efc47196b864138aebcd0bf68e3df0eb384ebdf0", + "version" : "1.0.0-beta.9" } } ], diff --git a/Package.swift b/Package.swift index 5b23d01..8065f22 100644 --- a/Package.swift +++ b/Package.swift @@ -22,7 +22,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/DevKitOrganization/DevTesting", from: "1.0.0-beta.7") + .package(url: "https://github.com/DevKitOrganization/DevTesting", from: "1.0.0-beta.9") ], targets: [ .target( diff --git a/Tests/DevKeychainTests/Core/KeychainTests.swift b/Tests/DevKeychainTests/Core/KeychainTests.swift index c6a672e..2f4c1de 100644 --- a/Tests/DevKeychainTests/Core/KeychainTests.swift +++ b/Tests/DevKeychainTests/Core/KeychainTests.swift @@ -164,13 +164,13 @@ struct KeychainTests: RandomValueGenerating { // Create some overlap between query dictionary and return dictionary var attributesDictionary = randomKeychainDictionary() as [CFString: Any] - attributesDictionary[kSecMatchLimit] = random(Float64.self, in: -10 ... 0) - attributesDictionary[kSecMatchCaseInsensitive] = random(Int.self, in: 2 ... .max) + attributesDictionary[kSecMatchLimit] = randomFloat64(in: -10 ... 0) + attributesDictionary[kSecMatchCaseInsensitive] = randomInt(in: 2 ... .max) var returnDictionary = randomKeychainDictionary() as [CFString: Any] returnDictionary[attributesDictionary.keys.randomElement()!] = randomAlphanumericString() - returnDictionary[kSecMatchLimit] = random(Float64.self, in: -10 ... 0) - returnDictionary[kSecMatchCaseInsensitive] = random(Int.self, in: 2 ... .max) + returnDictionary[kSecMatchLimit] = randomFloat64(in: -10 ... 0) + returnDictionary[kSecMatchCaseInsensitive] = randomInt(in: 2 ... .max) let keychainService = MockKeychainServices() keychainService.itemsStub = ThrowingStub(defaultResult: .success(expectedObject)) @@ -181,7 +181,7 @@ struct KeychainTests: RandomValueGenerating { query.returnDictionaryStub = Stub(defaultReturnValue: returnDictionary) var options = randomKeychainQueryOptions() - options.limit = isLimitNil ? nil : random(Int.self, in: 1 ... .max) + options.limit = isLimitNil ? nil : randomInt(in: 1 ... .max) let convertedValue = randomUUID() query.mapStub = ThrowingStub(defaultResult: .success([convertedValue])) @@ -244,7 +244,7 @@ struct Keychain_QueryOptionsTests: RandomValueGenerating { @Test mutating func initSetsValues() { let isCaseInsensitive = randomBool() - let limit = randomOptional(random(Int.self, in: .min ... .max)) + let limit = randomOptional(randomInt(in: .min ... .max)) let options = Keychain.QueryOptions(isCaseInsensitive: isCaseInsensitive, limit: limit) #expect(options.isCaseInsensitive == isCaseInsensitive) #expect(options.limit == limit) @@ -254,7 +254,7 @@ struct Keychain_QueryOptionsTests: RandomValueGenerating { @Test(arguments: [false, true]) mutating func oteamptionDictionaryIsCorrect(isLimitNil: Bool) { let isCaseInsensitive = randomBool() - let limit = isLimitNil ? nil : random(Int.self, in: .min ... .max) + let limit = isLimitNil ? nil : randomInt(in: .min ... .max) let options = Keychain.QueryOptions(isCaseInsensitive: isCaseInsensitive, limit: limit) let expected: [CFString: Any] = [ diff --git a/Tests/DevKeychainTests/Keychain Items/GenericPasswordTests.swift b/Tests/DevKeychainTests/Keychain Items/GenericPasswordTests.swift index 7eea3b3..3ba8042 100644 --- a/Tests/DevKeychainTests/Keychain Items/GenericPasswordTests.swift +++ b/Tests/DevKeychainTests/Keychain Items/GenericPasswordTests.swift @@ -87,7 +87,7 @@ struct GenericPasswordTests: RandomValueGenerating { for (key, type) in keysAndTypes { var attributes = dictionary - attributes[key] = random(Int.self, in: .min ... .max) + attributes[key] = randomInt(in: .min ... .max) #expect(throws: KeychainItemMappingError.attributeTypeMismatch(attribute: key as String, type: type)) { _ = try GenericPassword(attributes: attributes) @@ -327,7 +327,7 @@ struct GenericPassword_QueryTests: RandomValueGenerating { account: randomOptional(randomAlphanumericString()) ) - let expectedItems = Array(count: random(Int.self, in: 3 ... 5)) { + let expectedItems = Array(count: randomInt(in: 3 ... 5)) { GenericPassword( service: randomAlphanumericString(), account: randomAlphanumericString(), diff --git a/Tests/DevKeychainTests/Keychain Items/InternetPasswordTests.swift b/Tests/DevKeychainTests/Keychain Items/InternetPasswordTests.swift index 8c90b09..349dca6 100644 --- a/Tests/DevKeychainTests/Keychain Items/InternetPasswordTests.swift +++ b/Tests/DevKeychainTests/Keychain Items/InternetPasswordTests.swift @@ -87,7 +87,7 @@ struct InternetPasswordTests: RandomValueGenerating { for (key, type) in keysAndTypes { var attributes = dictionary - attributes[key] = random(Int.self, in: .min ... .max) + attributes[key] = randomInt(in: .min ... .max) #expect(throws: KeychainItemMappingError.attributeTypeMismatch(attribute: key as String, type: type)) { _ = try InternetPassword(attributes: attributes) @@ -327,7 +327,7 @@ struct InternetPassword_QueryTests: RandomValueGenerating { account: randomOptional(randomAlphanumericString()) ) - let expectedItems = Array(count: random(Int.self, in: 3 ... 5)) { + let expectedItems = Array(count: randomInt(in: 3 ... 5)) { InternetPassword( server: randomAlphanumericString(), account: randomAlphanumericString(), diff --git a/Tests/DevKeychainTests/Testing Helpers/RandomValueGenerating+DevKeychain.swift b/Tests/DevKeychainTests/Testing Helpers/RandomValueGenerating+DevKeychain.swift index bb67cbf..df1e14c 100644 --- a/Tests/DevKeychainTests/Testing Helpers/RandomValueGenerating+DevKeychain.swift +++ b/Tests/DevKeychainTests/Testing Helpers/RandomValueGenerating+DevKeychain.swift @@ -16,7 +16,7 @@ extension RandomValueGenerating { mutating func randomKeychainDictionary() -> [String: String] { - return Dictionary(count: random(Int.self, in: 3 ... 5)) { + return Dictionary(count: randomInt(in: 3 ... 5)) { (randomAlphanumericString(), randomAlphanumericString()) } } @@ -25,7 +25,7 @@ extension RandomValueGenerating { mutating func randomKeychainQueryOptions() -> Keychain.QueryOptions { return .init( isCaseInsensitive: randomBool(), - limit: randomOptional(random(Int.self, in: 1 ... 10)) + limit: randomOptional(randomInt(in: 1 ... 10)) ) } }