MCPcopy
hub / github.com/TomWright/dasel / TestKeyValues

Function TestKeyValues

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

Source from the content-addressed store, hash-verified

113}
114
115func TestKeyValues(t *testing.T) {
116 m := orderedmap.NewMap()
117 m.Set("x", 10)
118 m.Set("y", 20)
119
120 kvs := m.KeyValues()
121 if len(kvs) != 2 {
122 t.Fatalf("expected 2 pairs, got %d", len(kvs))
123 }
124 if kvs[0].Key != "x" || kvs[0].Value != 10 {
125 t.Fatalf("unexpected first pair: %v", kvs[0])
126 }
127 if kvs[1].Key != "y" || kvs[1].Value != 20 {
128 t.Fatalf("unexpected second pair: %v", kvs[1])
129 }
130}
131
132func TestEqual(t *testing.T) {
133 a := orderedmap.NewMap()

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
KeyValuesMethod · 0.95
NewMapFunction · 0.92

Tested by

no test coverage detected