mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
binance: fix parser tests
This commit is contained in:
parent
dcea623264
commit
85c14e5966
|
@ -127,7 +127,7 @@ func TestMarginResponseParsing(t *testing.T) {
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
payload := testcase.input
|
payload := testcase.input
|
||||||
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
||||||
event, err := parseWebSocketEvent(payload)
|
event, err := parseWebSocketEvent([]byte(payload))
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, event)
|
assert.NotNil(t, event)
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ func TestParseOrderUpdate(t *testing.T) {
|
||||||
|
|
||||||
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
||||||
|
|
||||||
event, err := parseWebSocketEvent(payload)
|
event, err := parseWebSocketEvent([]byte(payload))
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, event)
|
assert.NotNil(t, event)
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ func TestFuturesResponseParsing(t *testing.T) {
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
payload := testcase.input
|
payload := testcase.input
|
||||||
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
||||||
event, err := parseWebSocketEvent(payload)
|
event, err := parseWebSocketEvent([]byte(payload))
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, event)
|
assert.NotNil(t, event)
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ func TestParseOrderFuturesUpdate(t *testing.T) {
|
||||||
|
|
||||||
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
payload = jsCommentTrimmer.ReplaceAllLiteralString(payload, "")
|
||||||
|
|
||||||
event, err := parseWebSocketEvent(payload)
|
event, err := parseWebSocketEvent([]byte(payload))
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.NotNil(t, event)
|
assert.NotNil(t, event)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user