add test for parsing double encoded utf8
This commit is contained in:
parent
8d22de967e
commit
fe3599d1fe
@ -74,4 +74,18 @@ class SocketEngineTest: XCTestCase {
|
||||
engine.parseEngineMessage("afafafda", fromPolling: false)
|
||||
waitForExpectationsWithTimeout(3, handler: nil)
|
||||
}
|
||||
|
||||
func testEngineDecodesUTF8Properly() {
|
||||
let expectation = expectationWithDescription("Engine Decodes utf8")
|
||||
|
||||
client.on("stringTest") {data, ack in
|
||||
if let str = data[0] as? String {
|
||||
assert(str == "lïne one\nlīne \rtwo", "Failed string test")
|
||||
expectation.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
engine.parsePollingMessage("41:42[\"stringTest\",\"lïne one\\nlīne \\rtwo\"]")
|
||||
waitForExpectationsWithTimeout(3, handler: nil)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user