refactor(utils): 修复密码哈希比较逻辑错误 feat(user): 新增按状态筛选优惠券接口 docs: 添加虚拟发货与任务中心相关文档 fix(wechat): 修正Code2Session上下文传递问题 test: 补充订单折扣与积分转换测试用例 build: 更新配置文件与构建脚本 style: 清理多余的空行与注释
23 lines
520 B
Go
23 lines
520 B
Go
package points
|
|
|
|
import "testing"
|
|
|
|
func TestCentsToPoints_DefaultRate(t *testing.T) {
|
|
if got := CentsToPoints(12345, 1); got != 12345 {
|
|
t.Fatalf("expected 12345, got %d", got)
|
|
}
|
|
}
|
|
|
|
func TestPointsToCents_DefaultRate(t *testing.T) {
|
|
if got := PointsToCents(100, 1); got != 100 {
|
|
t.Fatalf("expected 100, got %d", got)
|
|
}
|
|
}
|
|
|
|
func TestRefundPointsAmount(t *testing.T) {
|
|
pts := RefundPointsAmount(5000, 2500, 10000, 1)
|
|
if pts != 12 {
|
|
t.Fatalf("expected 12, got %d", pts)
|
|
}
|
|
}
|