Add unit test case for #1175

This commit is contained in:
Qiu Yuzhou
2019-10-30 17:29:42 +08:00
parent ab6b6d41d4
commit 9f6fbd100a

View File

@ -91,6 +91,13 @@ class ServerProfileTests: XCTestCase {
XCTAssertNotNil(profile)
XCTAssertEqual(profile?.password, "test/!@#:")
}
func testInitWithLegacyURLWithEscapedChineseRemark() {
let url = URL(string: "ss://YmYtY2ZiOnRlc3RAMTkyLjE2OC4xMDAuMTo4ODg4#%e4%bd%a0%e5%a5%bd")!
let profile = ServerProfile(url: url)
XCTAssertNotNil(profile)
XCTAssertEqual(profile?.remark, "你好")
}
func testInitWithEmptyURL() {
let url = URL(string: "ss://")!