mirror of
https://github.com/xweiba/location-spoofer.git
synced 2026-09-21 22:30:46 +08:00
fix(version): 修正内置兜底版本号漂移并补版本一致性校验
This commit is contained in:
@@ -62,7 +62,7 @@ final class AppRemoteConfigurationTests: XCTestCase {
|
||||
func testFallbackMatchesCurrentProjectPolicy() {
|
||||
let configuration = AppRemoteConfiguration.fallback
|
||||
|
||||
XCTAssertEqual(configuration.latestVersion, "1.0.5")
|
||||
XCTAssertEqual(configuration.latestVersion, "1.0.7")
|
||||
XCTAssertEqual(configuration.minimumSupportedVersion, "1.0.0")
|
||||
XCTAssertFalse(configuration.requestsCommunityPrompt(for: .shadowrocket))
|
||||
for client in ThirdPartyProxyClient.allCases where client != .shadowrocket {
|
||||
|
||||
@@ -33,6 +33,15 @@ assert set(config["communityPromptClients"]) == {
|
||||
}
|
||||
PY
|
||||
|
||||
LATEST_VERSION="$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1], encoding="utf-8"))["latestVersion"])' "$ROOT/version.txt")"
|
||||
|
||||
grep -Fq "latestVersion: \"$LATEST_VERSION\"" "$CONFIG" \
|
||||
|| fail "Shared/AppRemoteConfiguration.swift fallback latestVersion must match version.txt ($LATEST_VERSION)"
|
||||
grep -Fq "version-v$LATEST_VERSION" "$ROOT/README.md" \
|
||||
|| fail "README.md version badge must match version.txt ($LATEST_VERSION)"
|
||||
grep -Fq "version-v$LATEST_VERSION" "$ROOT/README.en.md" \
|
||||
|| fail "README.en.md version badge must match version.txt ($LATEST_VERSION)"
|
||||
|
||||
grep -q 'static let fallback = AppRemoteConfiguration' "$CONFIG" \
|
||||
|| fail "the app must ship a built-in remote-configuration fallback"
|
||||
grep -q 'timeoutIntervalForRequest = 1.5' "$CONFIG" \
|
||||
|
||||
Reference in New Issue
Block a user