feat(seckill): 增加只读预演并强化代理风控切换
This commit is contained in:
@@ -16,6 +16,18 @@ import (
|
||||
"douyu_go/internal/types"
|
||||
)
|
||||
|
||||
func TestOrderErrorIncludesCode(t *testing.T) {
|
||||
err := (&OrderError{
|
||||
Kind: "锁定兑换商品失败",
|
||||
Code: 1644400007,
|
||||
Msg: "活动火爆,请稍后再试",
|
||||
}).Error()
|
||||
want := "锁定兑换商品失败(error=1644400007): 活动火爆,请稍后再试"
|
||||
if err != want {
|
||||
t.Fatalf("OrderError.Error()=%q, want %q", err, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerateCSRFUseCTNReusesCookie(t *testing.T) {
|
||||
var called atomic.Bool
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user