refactor(utils): 修复密码哈希比较逻辑错误 feat(user): 新增按状态筛选优惠券接口 docs: 添加虚拟发货与任务中心相关文档 fix(wechat): 修正Code2Session上下文传递问题 test: 补充订单折扣与积分转换测试用例 build: 更新配置文件与构建脚本 style: 清理多余的空行与注释
12 lines
334 B
Go
12 lines
334 B
Go
package app
|
|
|
|
import "testing"
|
|
|
|
func TestParseSlotFromRemark(t *testing.T) {
|
|
r := parseSlotFromRemark("lottery:activity:1|issue:2|count:1|slot:42")
|
|
if r != 42 { t.Fatalf("slot parse failed: %d", r) }
|
|
r2 := parseSlotFromRemark("lottery:activity:1|issue:2|count:1")
|
|
if r2 != -1 { t.Fatalf("expected -1, got %d", r2) }
|
|
}
|
|
|