MCPcopy
hub / github.com/lmorg/murex / TestHintSummary

Function TestHintSummary

shell/hintsummary/class_test.go:10–42  ·  view source on GitHub ↗

TestHintSummary tests the HintSummary structure

(t *testing.T)

Source from the content-addressed store, hash-verified

8
9// TestHintSummary tests the HintSummary structure
10func TestHintSummary(t *testing.T) {
11 count.Tests(t, 6)
12
13 summary := New()
14
15 summary.Set("cmd1", "sum1")
16 if summary.Get("cmd1") != "sum1" {
17 t.Error("Get (1) returns the wrong string")
18 }
19
20 summary.Set("cmd2", "sum2")
21 if summary.Get("cmd2") != "sum2" {
22 t.Error("Get (2) returns the wrong string")
23 }
24
25 summary.Set("cmd3", "sum3")
26 if summary.Get("cmd3") != "sum3" {
27 t.Error("Get (3) returns the wrong string")
28 }
29
30 if len(summary.Dump()) != 3 {
31 t.Error("length of summary map is incorrect")
32 }
33
34 err := summary.Delete("cmd1")
35 if err != nil {
36 t.Error(err.Error())
37 }
38
39 if len(summary.Dump()) != 2 {
40 t.Error("length of summary map is incorrect")
41 }
42}

Callers

nothing calls this directly

Calls 7

TestsFunction · 0.92
NewFunction · 0.70
SetMethod · 0.65
ErrorMethod · 0.65
DumpMethod · 0.65
GetMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected