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

Function TestMapKeyValues

model/value_map_test.go:202–214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

200}
201
202func TestMapKeyValues(t *testing.T) {
203 m := model.NewValue(orderedmap.NewMap().Set("a", "one").Set("b", "two"))
204 kvs, err := m.MapKeyValues()
205 if err != nil {
206 t.Fatal(err)
207 }
208 if len(kvs) != 2 {
209 t.Fatalf("expected 2 key-value pairs, got %d", len(kvs))
210 }
211 if kvs[0].Key != "a" || kvs[1].Key != "b" {
212 t.Errorf("unexpected keys: %s, %s", kvs[0].Key, kvs[1].Key)
213 }
214}

Callers

nothing calls this directly

Calls 4

MapKeyValuesMethod · 0.95
NewValueFunction · 0.92
NewMapFunction · 0.92
SetMethod · 0.45

Tested by

no test coverage detected