MCPcopy Create free account
hub / github.com/astercloud/aster / TestGenerateEventID

Function TestGenerateEventID

pkg/session/session_test.go:186–202  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

184}
185
186func 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
204func TestEventActions(t *testing.T) {
205 actions := EventActions{

Callers

nothing calls this directly

Calls 2

generateEventIDFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected