-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feature-search-keyboa…
…rd-shortcuts
- Loading branch information
Showing
11 changed files
with
176 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ jobs: | |
- name: Run Unit Tests on macOS | ||
if: matrix.platform == 'macOS' | ||
run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' | ||
run: xcodebuild test -scheme Kiwix -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO | ||
|
||
- name: Upload code coverage | ||
uses: codecov/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This file is part of Kiwix for iOS & macOS. | ||
// | ||
// Kiwix is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation; either version 3 of the License, or | ||
// any later version. | ||
// | ||
// Kiwix is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Kiwix; If not, see https://www.gnu.org/licenses/. | ||
|
||
import Foundation | ||
import Defaults | ||
|
||
public protocol Defaulting: NSObjectProtocol { | ||
subscript<Value: Defaults.Serializable>(key: Defaults.Key<Value>) -> Value { get set } | ||
} | ||
|
||
final class UDefaults: NSObject, Defaulting { | ||
subscript<Value>(key: Defaults.Key<Value>) -> Value where Value: DefaultsSerializable { | ||
get { | ||
Defaults[key] | ||
} | ||
set { | ||
Defaults[key] = newValue | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// This file is part of Kiwix for iOS & macOS. | ||
// | ||
// Kiwix is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation; either version 3 of the License, or | ||
// any later version. | ||
// | ||
// Kiwix is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Kiwix; If not, see https://www.gnu.org/licenses/. | ||
|
||
import Foundation | ||
import Defaults | ||
@testable import Kiwix | ||
|
||
final class TestDefaults: NSObject, Defaulting { | ||
|
||
var dict: [Defaults.AnyKey: any DefaultsSerializable] = [:] | ||
|
||
func setup() { | ||
self[.categoriesToLanguages] = [:] | ||
self[.libraryAutoRefresh] = false | ||
self[.libraryETag] = "" | ||
self[.libraryUsingOldISOLangCodes] = false | ||
self[.libraryLanguageCodes] = Set<String>() | ||
} | ||
|
||
subscript<Value>(key: Defaults.Key<Value>) -> Value where Value: DefaultsSerializable { | ||
get { | ||
// swiftlint:disable:next force_cast | ||
dict[key] as! Value | ||
} | ||
set { | ||
dict[key] = newValue | ||
} | ||
} | ||
} |
Oops, something went wrong.