优化订单结算金额展示和钱包流水号
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package wallet
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"hfb_sys/backend/internal/model"
|
||||
@@ -29,3 +30,14 @@ func TestApplyEntryRoundsMoneyBeforeComparing(t *testing.T) {
|
||||
t.Fatalf("FrozenBalance = %v, want 0", account.FrozenBalance)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewLedgerNoUsesReadableFormat(t *testing.T) {
|
||||
ledgerNo, err := newLedgerNo()
|
||||
if err != nil {
|
||||
t.Fatalf("newLedgerNo() error = %v", err)
|
||||
}
|
||||
matched := regexp.MustCompile(`^WL\d{21}$`).MatchString(ledgerNo)
|
||||
if !matched {
|
||||
t.Fatalf("ledgerNo = %q, want WL + 21 digits", ledgerNo)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user