mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-03 15:02:13 +08:00
test: stabilize subscription progress day assertion
This commit is contained in:
@@ -34,9 +34,10 @@ func TestCalculateProgress_BasicFields(t *testing.T) {
|
||||
assert.Equal(t, int64(100), progress.ID)
|
||||
assert.Equal(t, "Premium", progress.GroupName)
|
||||
assert.Equal(t, sub.ExpiresAt, progress.ExpiresAt)
|
||||
assert.Equal(t, 29, progress.ExpiresInDays) // 约 30 天
|
||||
assert.Nil(t, progress.Daily, "无日限额时 Daily 应为 nil")
|
||||
assert.Nil(t, progress.Weekly, "无周限额时 Weekly 应为 nil")
|
||||
assert.GreaterOrEqual(t, progress.ExpiresInDays, 29)
|
||||
assert.LessOrEqual(t, progress.ExpiresInDays, 30)
|
||||
assert.Nil(t, progress.Daily)
|
||||
assert.Nil(t, progress.Weekly)
|
||||
assert.Nil(t, progress.Monthly, "无月限额时 Monthly 应为 nil")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user