Skip to content

Commit

Permalink
Merge pull request #247 from tatsuz0u/develop
Browse files Browse the repository at this point in the history
Final version from @tatsuz0u
  • Loading branch information
tatsuz0u authored Apr 9, 2022
2 parents d51490b + 48e71d9 commit b1fa925
Show file tree
Hide file tree
Showing 59 changed files with 795 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [closed]
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
APP_VERSION: '2.3.1'
APP_VERSION: '2.4.0'
SCHEME_NAME: 'EhPanda'
ALTSTORE_JSON_PATH: './AltStore.json'
BUILDS_PATH: '/tmp/action-builds'
Expand Down
62 changes: 61 additions & 1 deletion EhPanda.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
AB6505A026B0027800F91E9D /* SwiftUIPager in Frameworks */ = {isa = PBXBuildFile; productRef = AB65059F26B0027800F91E9D /* SwiftUIPager */; };
AB69CB8026B3DABC00699359 /* AdvancedList.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB69CB7F26B3DABC00699359 /* AdvancedList.swift */; };
AB69CB8226B3DAF400699359 /* ControlPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB69CB8126B3DAF400699359 /* ControlPanel.swift */; };
AB6D106A27EBF890003A2245 /* GeneralSettingStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB6D106927EBF890003A2245 /* GeneralSettingStoreTests.swift */; };
AB6DE897268822390087C579 /* LogsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB6DE896268822390087C579 /* LogsView.swift */; };
AB706F7927890A6C0025A48A /* AppRouteStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB706F7827890A6C0025A48A /* AppRouteStore.swift */; };
AB706F7B278937500025A48A /* FrontpageStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB706F7A278937500025A48A /* FrontpageStore.swift */; };
Expand Down Expand Up @@ -175,8 +176,11 @@
AB86AC1327856F2700E61E6A /* AppLockStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB86AC1227856F2700E61E6A /* AppLockStore.swift */; };
AB86AC1A2785C2B300E61E6A /* HomeStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB86AC192785C2B300E61E6A /* HomeStore.swift */; };
AB8C821926BF801700E8C5E6 /* EhSetting.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB8C821826BF801700E8C5E6 /* EhSetting.swift */; };
ABA12F3227D49CEB0021922D /* AccountSettingStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA12F3127D49CEB0021922D /* AccountSettingStoreTests.swift */; };
ABA732D925A8018A00B3D9AB /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA732D825A8018A00B3D9AB /* Extensions.swift */; };
ABA732DF25A852D800B3D9AB /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA732DE25A852D800B3D9AB /* Filter.swift */; };
ABAB5B9527EF023300198597 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABAB5B9427EF023300198597 /* Extensions.swift */; };
ABAB5B9727EF03F600198597 /* AppearanceSettingStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABAB5B9627EF03F600198597 /* AppearanceSettingStoreTests.swift */; };
ABAC82FE26BC4A96009F5026 /* OpenCC in Frameworks */ = {isa = PBXBuildFile; productRef = ABAC82FD26BC4A96009F5026 /* OpenCC */; };
ABBB2631278E6EF3007B6149 /* SearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABBB2630278E6EF3007B6149 /* SearchView.swift */; };
ABBB2633278E6F3B007B6149 /* SearchStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABBB2632278E6F3B007B6149 /* SearchStore.swift */; };
Expand Down Expand Up @@ -237,6 +241,11 @@
ABD9771027B65E3400983DE7 /* GalleryDetailParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABD9770F27B65E3400983DE7 /* GalleryDetailParserTests.swift */; };
ABD9771327B6612400983DE7 /* GreetingParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABD9771227B6612400983DE7 /* GreetingParserTests.swift */; };
ABE1867826A1733000689FDC /* LaboratorySettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE1867726A1733000689FDC /* LaboratorySettingView.swift */; };
ABE9012227F722D100F3651D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = ABE9011D27F722D000F3651D /* [email protected] */; };
ABE9012327F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad.png in Resources */ = {isa = PBXBuildFile; fileRef = ABE9011E27F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad.png */; };
ABE9012427F722D100F3651D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = ABE9011F27F722D100F3651D /* [email protected] */; };
ABE9012527F722D100F3651D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = ABE9012027F722D100F3651D /* [email protected] */; };
ABE9012627F722D100F3651D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = ABE9012127F722D100F3651D /* [email protected] */; };
ABE9401526FF158D0085E158 /* QuickSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE9401426FF158D0085E158 /* QuickSearchView.swift */; };
ABE9402D26FF89220085E158 /* AlertKit in Frameworks */ = {isa = PBXBuildFile; productRef = ABE9402C26FF89220085E158 /* AlertKit */; };
ABEA1FE625A9B40B002966B9 /* Setting.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEA1FE525A9B40B002966B9 /* Setting.swift */; };
Expand Down Expand Up @@ -400,6 +409,7 @@
AB63EADC2699AC9100090535 /* AppEnvMO+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppEnvMO+CoreDataClass.swift"; sourceTree = "<group>"; };
AB69CB7F26B3DABC00699359 /* AdvancedList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedList.swift; sourceTree = "<group>"; };
AB69CB8126B3DAF400699359 /* ControlPanel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlPanel.swift; sourceTree = "<group>"; };
AB6D106927EBF890003A2245 /* GeneralSettingStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralSettingStoreTests.swift; sourceTree = "<group>"; };
AB6DE896268822390087C579 /* LogsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogsView.swift; sourceTree = "<group>"; };
AB706F7827890A6C0025A48A /* AppRouteStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppRouteStore.swift; sourceTree = "<group>"; };
AB706F7A278937500025A48A /* FrontpageStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontpageStore.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -464,8 +474,11 @@
AB86AC192785C2B300E61E6A /* HomeStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeStore.swift; sourceTree = "<group>"; };
AB8C821826BF801700E8C5E6 /* EhSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhSetting.swift; sourceTree = "<group>"; };
AB994DBB25986F7A00E9A367 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
ABA12F3127D49CEB0021922D /* AccountSettingStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSettingStoreTests.swift; sourceTree = "<group>"; };
ABA732D825A8018A00B3D9AB /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
ABA732DE25A852D800B3D9AB /* Filter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Filter.swift; sourceTree = "<group>"; };
ABAB5B9427EF023300198597 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
ABAB5B9627EF03F600198597 /* AppearanceSettingStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceSettingStoreTests.swift; sourceTree = "<group>"; };
ABB5013026A41EBA00B542D9 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
ABB5013126A41EBA00B542D9 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = "<group>"; };
ABBB2630278E6EF3007B6149 /* SearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -525,6 +538,11 @@
ABD9770F27B65E3400983DE7 /* GalleryDetailParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryDetailParserTests.swift; sourceTree = "<group>"; };
ABD9771227B6612400983DE7 /* GreetingParserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GreetingParserTests.swift; sourceTree = "<group>"; };
ABE1867726A1733000689FDC /* LaboratorySettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaboratorySettingView.swift; sourceTree = "<group>"; };
ABE9011D27F722D000F3651D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
ABE9011E27F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AppIcon_StandWithUkraine2022_iPad.png; sourceTree = "<group>"; };
ABE9011F27F722D100F3651D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
ABE9012027F722D100F3651D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
ABE9012127F722D100F3651D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
ABE9376C265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
ABE9376D265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
ABE9401426FF158D0085E158 /* QuickSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickSearchView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -767,9 +785,9 @@
AB3E9E6126D210B1008FE518 /* EhPandaTests */ = {
isa = PBXGroup;
children = (
ABA12F2E27D49AD10021922D /* Tests */,
AB31CD2E27B666D500F40E0A /* Models */,
AB3E9E6226D210B1008FE518 /* Resources */,
ABD9770C27B65A5300983DE7 /* Parser */,
);
path = EhPandaTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -835,6 +853,7 @@
isa = PBXGroup;
children = (
AB3E9E6D26D210B1008FE518 /* TestHelper.swift */,
ABAB5B9427EF023300198597 /* Extensions.swift */,
);
path = Utility;
sourceTree = "<group>";
Expand Down Expand Up @@ -865,6 +884,11 @@
AB0CFB8527BBD2D7004BD372 /* AppIcon_Developer_iPad.png */,
AB0CFB8327BBD2D7004BD372 /* [email protected] */,
AB0CFB8427BBD2D7004BD372 /* [email protected] */,
ABE9012027F722D100F3651D /* [email protected] */,
ABE9011E27F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad.png */,
ABE9012127F722D100F3651D /* [email protected] */,
ABE9011D27F722D000F3651D /* [email protected] */,
ABE9011F27F722D100F3651D /* [email protected] */,
AB0CFB8727BBD2D7004BD372 /* [email protected] */,
AB0CFB8F27BBD323004BD372 /* [email protected] */,
AB0CFB9027BBD323004BD372 /* AppIcon_Ukiyoe_iPad.png */,
Expand Down Expand Up @@ -1067,6 +1091,33 @@
path = Search;
sourceTree = "<group>";
};
ABA12F2E27D49AD10021922D /* Tests */ = {
isa = PBXGroup;
children = (
ABA12F2F27D49B610021922D /* Store */,
ABD9770C27B65A5300983DE7 /* Parser */,
);
path = Tests;
sourceTree = "<group>";
};
ABA12F2F27D49B610021922D /* Store */ = {
isa = PBXGroup;
children = (
ABA12F3027D49CDA0021922D /* Setting */,
);
path = Store;
sourceTree = "<group>";
};
ABA12F3027D49CDA0021922D /* Setting */ = {
isa = PBXGroup;
children = (
ABA12F3127D49CEB0021922D /* AccountSettingStoreTests.swift */,
AB6D106927EBF890003A2245 /* GeneralSettingStoreTests.swift */,
ABAB5B9627EF03F600198597 /* AppearanceSettingStoreTests.swift */,
);
path = Setting;
sourceTree = "<group>";
};
ABBB263C2793C580007B6149 /* DataFlow */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1467,17 +1518,22 @@
ABC3C7852593699B00E0C11B /* Assets.xcassets in Resources */,
AB0CFB7B27BAB9D0004BD372 /* AppIcon_Default_iPad.png in Resources */,
AB0CFB9527BBD323004BD372 /* AppIcon_Ukiyoe_iPad.png in Resources */,
ABE9012427F722D100F3651D /* [email protected] in Resources */,
AB0CFB8827BBD2D7004BD372 /* [email protected] in Resources */,
ABE9012227F722D100F3651D /* [email protected] in Resources */,
AB0CFB7427BAB9D0004BD372 /* [email protected] in Resources */,
AB7E6B3025D24FE00035CC68 /* InfoPlist.strings in Resources */,
AB0CFB9327BBD323004BD372 /* [email protected] in Resources */,
AB0CFB8927BBD2D7004BD372 /* [email protected] in Resources */,
ABEE0AFA2595C6F800C997AE /* Localizable.strings in Resources */,
ABD5FDD4263D05110021A4C6 /* .swiftlint.yml in Resources */,
AB26F59B27AD125A00AB3468 /* Constant.strings in Resources */,
ABE9012527F722D100F3651D /* [email protected] in Resources */,
ABE9012327F722D100F3651D /* AppIcon_StandWithUkraine2022_iPad.png in Resources */,
AB0CFB7827BAB9D0004BD372 /* [email protected] in Resources */,
AB0CFB8B27BBD2D7004BD372 /* [email protected] in Resources */,
AB0CFB8A27BBD2D7004BD372 /* AppIcon_Developer_iPad.png in Resources */,
ABE9012627F722D100F3651D /* [email protected] in Resources */,
AB0CFB9427BBD323004BD372 /* [email protected] in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1761,13 +1817,17 @@
AB0CFB8227BBBFCE004BD372 /* EhSettingParserTests.swift in Sources */,
AB31CD4327B676C300F40E0A /* GalleryMPVKeysParserTests.swift in Sources */,
AB31CD3027B666E200F40E0A /* TestError.swift in Sources */,
ABAB5B9727EF03F600198597 /* AppearanceSettingStoreTests.swift in Sources */,
ABD9771027B65E3400983DE7 /* GalleryDetailParserTests.swift in Sources */,
AB31CD3227B6671400F40E0A /* BanIntervalParserTests.swift in Sources */,
ABD9771327B6612400983DE7 /* GreetingParserTests.swift in Sources */,
AB31CD3727B6695800F40E0A /* HTMLFilename.swift in Sources */,
ABA12F3227D49CEB0021922D /* AccountSettingStoreTests.swift in Sources */,
AB3E9E7426D210B1008FE518 /* TestHelper.swift in Sources */,
AB6D106A27EBF890003A2245 /* GeneralSettingStoreTests.swift in Sources */,
AB31CD3B27B66E0300F40E0A /* ListParserTestType.swift in Sources */,
ABD9770E27B65A7300983DE7 /* ListParserTests.swift in Sources */,
ABAB5B9527EF023300198597 /* Extensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/Co2333/Colorful.git",
"state": {
"branch": null,
"revision": "eb5a350aec759bd413615273cb6d64553aead4d5",
"version": "1.0.1"
"revision": "0bcf960c856d9f7cde10a0b464208585736c5e47",
"version": "1.1.0"
}
},
{
Expand Down Expand Up @@ -60,8 +60,8 @@
"repositoryURL": "https://github.com/onevcat/Kingfisher.git",
"state": {
"branch": null,
"revision": "0c02c46cfdc0656ce74fd0963a75e5000a0b7f23",
"version": "7.1.2"
"revision": "32e4acdf6971f58f5ad552389cf2d7d016334eaf",
"version": "7.2.0"
}
},
{
Expand All @@ -78,7 +78,7 @@
"repositoryURL": "https://github.com/SFSafeSymbols/SFSafeSymbols.git",
"state": {
"branch": "stable",
"revision": "846e558cda47e1a2d2cea988a9c18378f830bddf",
"revision": "7bb874408110c6aa80056f81177ee732071195f8",
"version": null
}
},
Expand All @@ -105,8 +105,8 @@
"repositoryURL": "https://github.com/pointfreeco/swift-composable-architecture.git",
"state": {
"branch": null,
"revision": "ba9c626ab1b2b6af8cf684eebb2ab472fa5b6753",
"version": "0.33.1"
"revision": "2828dc44f6e3f81d84bcaba72c1ab1c0121d66f6",
"version": "0.34.0"
}
},
{
Expand Down
Binary file modified EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified EhPanda/App/Icons/AppIcon_Developer_iPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EhPanda/App/Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions EhPanda/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
<string>AppIcon_Developer</string>
</array>
</dict>
<key>AppIcon_StandWithUkraine2022</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_StandWithUkraine2022</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
Expand Down Expand Up @@ -70,6 +77,14 @@
<string>AppIcon_Developer_iPad_Pro</string>
</array>
</dict>
<key>AppIcon_StandWithUkraine2022</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon_StandWithUkraine2022_iPad</string>
<string>AppIcon_StandWithUkraine2022_iPad_Pro</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
Expand Down
21 changes: 21 additions & 0 deletions EhPanda/App/Tools/Clients/AuthorizationClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,24 @@ extension AuthorizationClient {
}
)
}

// MARK: Test
#if DEBUG
import XCTestDynamicOverlay

extension AuthorizationClient {
static let failing: Self = .init(
passcodeNotSet: {
XCTFail("\(Self.self).passcodeNotSet is unimplemented")
return false
},
localAuthroize: { .failing("\(Self.self).localAuthroize(\($0)) is unimplemented")}
)
}
#endif
extension AuthorizationClient {
static let noop: Self = .init(
passcodeNotSet: { false },
localAuthroize: { _ in .none }
)
}
28 changes: 28 additions & 0 deletions EhPanda/App/Tools/Clients/ClipboardClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,31 @@ extension ClipboardClient {
}
)
}

// MARK: Test
#if DEBUG
import XCTestDynamicOverlay

extension ClipboardClient {
static let failing: Self = .init(
url: {
XCTFail("\(Self.self).url is unimplemented")
return nil
},
changeCount: {
XCTFail("\(Self.self).changeCount is unimplemented")
return 0
},
saveText: { .failing("\(Self.self).saveText(\($0)) is unimplemented") },
saveImage: { .failing("\(Self.self).saveImage(\($0), \($1)) is unimplemented") }
)
}
#endif
extension ClipboardClient {
static let noop: Self = .init(
url: { nil },
changeCount: { 0 },
saveText: { _ in .none },
saveImage: { _, _ in .none }
)
}
35 changes: 35 additions & 0 deletions EhPanda/App/Tools/Clients/CookiesClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,38 @@ extension CookiesClient {
}
}
}

// MARK: Test
#if DEBUG
import XCTestDynamicOverlay

extension CookiesClient {
static let failing: Self = .init(
clearAll: { .failing("\(Self.self).clearAll is unimplemented") },
getCookie: {
XCTFail("\(Self.self).getCookie(\($0), \($1)) is unimplemented")
return .empty
},
removeCookie: {
XCTFail("\(Self.self).removeCookie(\($0), \($1)) is unimplemented")
},
checkExistence: {
XCTFail("\(Self.self).checkExistence(\($0), \($1)) is unimplemented")
return false
},
initializeCookie: {
XCTFail("\(Self.self).initializeCookie(\($0), \($1)) is unimplemented")
return .init()
}
)
}
#endif
extension CookiesClient {
static let noop: Self = .init(
clearAll: { .none },
getCookie: { _, _ in .empty },
removeCookie: { _, _ in },
checkExistence: { _, _ in false },
initializeCookie: { _, _ in .init() }
)
}
Loading

0 comments on commit b1fa925

Please sign in to comment.