Publish reviewed history-free open-source snapshot (2026-10-12)

This commit is contained in:
Zonghengjia Open Source
2026-10-11 23:23:20 +00:00
commit 901f27baf5
301 changed files with 32378 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import XCTest
@testable import UCVLZonghengjia
final class ClientConfigResponseTests: XCTestCase {
func testDecodesVersionedGatewayContract() throws {
let data = Data(#"{"config_contract":2,"gateway":{"host":"vpn.toplc.cn","ipv4":"192.0.2.1"},"node":{"slug":"n1","name":"VPN001","region":"东京","status":"online"},"route_mode":"smart","config":{}}"#.utf8)
let response = try JSONDecoder().decode(ClientConfigResponse.self, from: data)
XCTAssertEqual(response.configContract, 2)
XCTAssertEqual(response.gateway?.host, "vpn.toplc.cn")
XCTAssertEqual(response.gateway?.ipv4, "192.0.2.1")
}
func testOldBackendPayloadRemainsCompatible() throws {
let data = Data(#"{"node":{"slug":"n1","name":"VPN001","region":"东京","status":"online"},"route_mode":"smart","config":{}}"#.utf8)
let response = try JSONDecoder().decode(ClientConfigResponse.self, from: data)
XCTAssertNil(response.configContract)
XCTAssertNil(response.gateway)
}
}