MCPcopy Index your code
hub / github.com/TomWright/dasel / TestSetOverwrite

Function TestSetOverwrite

model/orderedmap/map_test.go:38–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestSetOverwrite(t *testing.T) {
39 m := orderedmap.NewMap()
40 m.Set("a", 1)
41 m.Set("a", 2)
42
43 v, _ := m.Get("a")
44 if v != 2 {
45 t.Fatalf("expected 2, got %v", v)
46 }
47 // Overwrite must not duplicate the key.
48 if m.Len() != 1 {
49 t.Fatalf("expected Len 1, got %d", m.Len())
50 }
51}
52
53func TestDelete(t *testing.T) {
54 m := orderedmap.NewMap()

Callers

nothing calls this directly

Calls 4

SetMethod · 0.95
GetMethod · 0.95
LenMethod · 0.95
NewMapFunction · 0.92

Tested by

no test coverage detected