mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
修改测试用例的错误
This commit is contained in:
@@ -10,10 +10,7 @@ import (
|
|||||||
0c02000000011a001a003e05050000000000000002000030303030303101363030303038
|
0c02000000011a001a003e05050000000000000002000030303030303101363030303038
|
||||||
*/
|
*/
|
||||||
func TestNewSecurityQuotes(t *testing.T) {
|
func TestNewSecurityQuotes(t *testing.T) {
|
||||||
f, err := MStockQuote.Frame(map[Exchange]string{
|
f, err := MQuote.Frame("sz000001", "sh600008")
|
||||||
ExchangeSH: "000001",
|
|
||||||
ExchangeSZ: "600008",
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
@@ -48,12 +45,12 @@ func Test_getPrice(t *testing.T) {
|
|||||||
0c020000000106000600500400000000
|
0c020000000106000600500400000000
|
||||||
*/
|
*/
|
||||||
func Test_securityList_Frame(t *testing.T) {
|
func Test_securityList_Frame(t *testing.T) {
|
||||||
f := MStockList.Frame(ExchangeSH, 0)
|
f := MCode.Frame(ExchangeSH, 0)
|
||||||
t.Log(f.Bytes().HEX())
|
t.Log(f.Bytes().HEX())
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_stockCount_Frame(t *testing.T) {
|
func Test_stockCount_Frame(t *testing.T) {
|
||||||
//预期0c0200000001080008004e04000075c73301
|
//预期0c0200000001080008004e04000075c73301
|
||||||
// 0c0000000001070007004e040075c73301
|
// 0c0000000001070007004e040075c73301
|
||||||
t.Log(MStockCount.Frame(ExchangeSH).Bytes().HEX())
|
t.Log(MCount.Frame(ExchangeSH).Bytes().HEX())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ package protocol
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_stockHistoryMinuteTrade_Frame(t *testing.T) {
|
func Test_stockHistoryMinuteTrade_Frame(t *testing.T) {
|
||||||
// 预期 0c 02000000 00 1200 1200 b50f 84da3401 0000 30303030303100006400
|
// 预期 0c 02000000 00 1200 1200 b50f 84da3401 0000 30303030303100006400
|
||||||
// 0c000000000112001200b50f84da3401000030303030303100006400
|
// 0c000000000112001200b50f84da3401000030303030303100006400
|
||||||
f, err := MStockHistoryMinuteTrade.Frame(StockHistoryMinuteTradeReq{
|
f, err := MHistoryMinuteTrade.Frame(HistoryMinuteTradeReq{
|
||||||
Time: time.Date(2024, 10, 28, 0, 0, 0, 0, time.Local),
|
Date: "20241028",
|
||||||
Exchange: ExchangeSZ,
|
Exchange: ExchangeSZ,
|
||||||
Code: "000001",
|
Code: "000001",
|
||||||
Start: 0,
|
Start: 0,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
func Test_stockKline_Frame(t *testing.T) {
|
func Test_stockKline_Frame(t *testing.T) {
|
||||||
//预期0c02000000001c001c002d050000303030303031 0900 0100 0000 0a00 00000000000000000000
|
//预期0c02000000001c001c002d050000303030303031 0900 0100 0000 0a00 00000000000000000000
|
||||||
// 0c00000000011c001c002d050000313030303030 0900 0000 0000 0a00 00000000000000000000
|
// 0c00000000011c001c002d050000313030303030 0900 0000 0000 0a00 00000000000000000000
|
||||||
f, _ := MStockKline.Frame(TypeKlineDay, &StockKlineReq{
|
f, _ := MKline.Frame(TypeKlineDay, KlineReq{
|
||||||
Exchange: ExchangeSH,
|
Exchange: ExchangeSH,
|
||||||
Code: "000001",
|
Code: "000001",
|
||||||
Start: 0,
|
Start: 0,
|
||||||
@@ -24,7 +24,7 @@ func Test_stockKline_Decode(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, err := MStockKline.Decode(bs, 9)
|
resp, err := MKline.Decode(bs, 9)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
|
|||||||
15
protocol/model_quote_test.go
Normal file
15
protocol/model_quote_test.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package protocol
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_quote_Frame(t *testing.T) {
|
||||||
|
//0c0000000001130013003e050500000000000000010000303030303031
|
||||||
|
f, err := MQuote.Frame("sz000001")
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
t.Log(f.Bytes().HEX())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user