|
|
@@ -52,10 +52,10 @@ func recommendCompare(c Case, lg, tg *SideResult) ([]Diff, []Assertion) {
|
|
|
if referrerAbsent && (g.name == "推荐人·全局" || g.name == "推荐人·校区") {
|
|
|
continue
|
|
|
}
|
|
|
- lgDBal := g.lgB.Balance - g.lgA.Balance
|
|
|
- lgDRec := g.lgB.Recommended - g.lgA.Recommended
|
|
|
- tgDBal := g.tgB.Balance - g.tgA.Balance
|
|
|
- tgDRec := g.tgB.Recommended - g.tgA.Recommended
|
|
|
+ lgDBal := delta(g.lgA.Balance, g.lgB.Balance)
|
|
|
+ lgDRec := delta(g.lgA.Recommended, g.lgB.Recommended)
|
|
|
+ tgDBal := delta(g.tgA.Balance, g.tgB.Balance)
|
|
|
+ tgDRec := delta(g.tgA.Recommended, g.tgB.Recommended)
|
|
|
add(g.name+"·Δbalance", fmt.Sprintf("%+d", lgDBal), fmt.Sprintf("%+d", tgDBal),
|
|
|
lgDBal == tgDBal, "分")
|
|
|
add(g.name+"·Δtotal_recommended_amount", fmt.Sprintf("%+d", lgDRec), fmt.Sprintf("%+d", tgDRec),
|
|
|
@@ -144,10 +144,10 @@ func recommendCompare(c Case, lg, tg *SideResult) ([]Diff, []Assertion) {
|
|
|
|
|
|
// 正向断言(F22 同族):**两个用户**的钱都真的动了。
|
|
|
// 少了这条,"两侧都不动 ⇒ 全 0 相等"会全绿 —— 而那正是"游标没进循环"的形态。
|
|
|
- lgUser := lg.After.Global.Balance - lg.Before.Global.Balance
|
|
|
- tgUser := tg.After.Global.Balance - tg.Before.Global.Balance
|
|
|
- lgRec := lg.After.Recommender.Balance - lg.Before.Recommender.Balance
|
|
|
- tgRec := tg.After.Recommender.Balance - tg.Before.Recommender.Balance
|
|
|
+ lgUser := delta(lg.Before.Global.Balance, lg.After.Global.Balance)
|
|
|
+ tgUser := delta(tg.Before.Global.Balance, tg.After.Global.Balance)
|
|
|
+ lgRec := delta(lg.Before.Recommender.Balance, lg.After.Recommender.Balance)
|
|
|
+ tgRec := delta(tg.Before.Recommender.Balance, tg.After.Recommender.Balance)
|
|
|
asserts = append(asserts, Assertion{Kind: AssertionBusiness,
|
|
|
Name: "本 case 的**两个用户**的钱都真的动了(被推荐人与推荐人的 Δbalance 均 > 0;任一为 0 ⇒ FAIL)",
|
|
|
Pass: lgUser > 0 && tgUser > 0 && lgRec > 0 && tgRec > 0,
|