MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / TestRecordAssignsMonotonicIDs

Function TestRecordAssignsMonotonicIDs

internal/debug/debug_test.go:27–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestRecordAssignsMonotonicIDs(t *testing.T) {
28 debug.SetEnabled(true)
29 t.Cleanup(func() { debug.SetEnabled(false) })
30 debug.Clear()
31
32 id1 := debug.Record("src", debug.LevelInfo, "a")
33 id2 := debug.Record("src", debug.LevelInfo, "b")
34 id3 := debug.Record("src", debug.LevelInfo, "c")
35
36 if id1 == 0 {
37 t.Error("Record returned 0 while enabled")
38 }
39 if id2 != id1+1 || id3 != id2+1 {
40 t.Errorf("IDs not sequential: %d, %d, %d", id1, id2, id3)
41 }
42}
43
44func TestSnapshotReturnsCopy(t *testing.T) {
45 debug.SetEnabled(true)

Callers

nothing calls this directly

Calls 3

SetEnabledFunction · 0.92
ClearFunction · 0.92
RecordFunction · 0.92

Tested by

no test coverage detected