补齐三类日志的触发操作和结果并完善运行事件展示
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-09 02:48:07 +08:00
1 parent b50e5bdfa2
commit dd6258c98b
34 files changed
+734 -87

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package send
import "testing"
func TestDeliveryLogResultUsesConfirmedRecipientCount(t *testing.T) {
for _, item := range []struct {
accepted, total int
failed bool
want string
}{
{3, 3, false, "accepted"},
{1, 3, true, "partial"},
{1, 3, false, "partial"},
{3, 3, true, "partial"},
{0, 3, true, "failure"},
{0, 3, false, "unknown"},
{0, 0, false, "unknown"},
} {
if got := deliveryLogResult(item.accepted, item.total, item.failed); got != item.want {
t.Fatalf("接收人数 %d/%d,失败=%v:得到 %s,期望 %s", item.accepted, item.total, item.failed, got, item.want)
}
}
}