vapor / websocket-kit

WebSocket client library built on SwiftNIO

Home Page:https://docs.vapor.codes/4.0/advanced/websockets/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test case failed

michaelhenry opened this issue · comments

commented
websocket/Tests/WebSocketTests/WebSocketTests.swift:106: error: 
-[WebSocketTests.WebSocketTests testServerContinuation] : 
XCTAssertEqual failed: ("/") is not equal to ("!dlrow ,olleH")
commented

I wasn't sure but the first call in onText closure returned, / and the next one is the correct one( !dlrow ,olleH), The question is why .onText() an initial value of /.

        client.onText { ws, text in
            XCTAssertEqual(text, "!dlrow ,olleH")
            _ = server.close()
        }
        client.send(raw: "Hello, ", opcode: .text, fin: false)
        client.send(raw: "world", opcode: .continuation, fin: false)
        client.send(raw: "!", opcode: .continuation)
commented

Oh I see, the server is sending the path onUpgrade initially before sending back the strings.