(t *testing.T)
| 184 | } |
| 185 | |
| 186 | func TestGenerateEventID(t *testing.T) { |
| 187 | id1 := generateEventID() |
| 188 | id2 := generateEventID() |
| 189 | |
| 190 | if id1 == "" { |
| 191 | t.Error("expected non-empty event ID") |
| 192 | } |
| 193 | |
| 194 | if id2 == "" { |
| 195 | t.Error("expected non-empty event ID") |
| 196 | } |
| 197 | |
| 198 | // IDs 应该不同(虽然在同一秒内可能相同,但这个测试主要验证格式) |
| 199 | if len(id1) < 4 || id1[:4] != "evt_" { |
| 200 | t.Errorf("expected event ID to start with 'evt_', got %s", id1) |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | func TestEventActions(t *testing.T) { |
| 205 | actions := EventActions{ |
nothing calls this directly
no test coverage detected