binance: fix parser tests

This commit is contained in:
c9s 2022-01-02 02:44:47 +08:00
parent dcea623264
commit 85c14e5966

View File

@ -127,7 +127,7 @@ func TestMarginResponseParsing(t *testing.T) {
for _, testcase := range testcases {
payload := testcase.input
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
event, err := parseWebSocketEvent(payload)
event, err := parseWebSocketEvent([]byte(payload))
assert.NoError(t, err)
assert.NotNil(t, event)
}
@ -171,7 +171,7 @@ func TestParseOrderUpdate(t *testing.T) {
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
event, err := parseWebSocketEvent(payload)
event, err := parseWebSocketEvent([]byte(payload))
assert.NoError(t, err)
assert.NotNil(t, event)
@ -333,7 +333,7 @@ func TestFuturesResponseParsing(t *testing.T) {
for _, testcase := range testcases {
payload := testcase.input
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
event, err := parseWebSocketEvent(payload)
event, err := parseWebSocketEvent([]byte(payload))
assert.NoError(t, err)
assert.NotNil(t, event)
}
@ -381,7 +381,7 @@ func TestParseOrderFuturesUpdate(t *testing.T) {
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
event, err := parseWebSocketEvent(payload)
event, err := parseWebSocketEvent([]byte(payload))
assert.NoError(t, err)
assert.NotNil(t, event)