| 1 | package execution_testscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.25 testing/" |
| 5 | |
| 6 | "github.com/tomwright/dasel/v3/modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/" |
| 7 | ) |
| 8 | |
| 9 | func TestFuncEntriesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/TestFuncEntries().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 10 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("map to entries", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 11 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `{"a": 1, "b": 2}.entries()`, |
| 12 | outFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#outFn.: func() *modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value# { |
| 13 | r := modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewSliceValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewSliceValue().() |
| 14 | |
| 15 | e1 := modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewMapValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewMapValue().() |
| 16 | _ = e1.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("key", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewStringValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewStringValue().("a")) |
| 17 | _ = e1.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("value", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewIntValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewIntValue().(1)) |
| 18 | _ = r.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(e1) |
| 19 | |
| 20 | e2 := modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewMapValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewMapValue().() |
| 21 | _ = e2.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("key", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewStringValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewStringValue().("b")) |
| 22 | _ = e2.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("value", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewIntValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewIntValue().(2)) |
| 23 | _ = r.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(e2) |
| 24 | |
| 25 | return r |
| 26 | }, |
| 27 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 28 | } |
| 29 | |
| 30 | func TestFuncFromEntriesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/TestFuncFromEntries().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 31 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("entries to map", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 32 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `[{"key": "a", "value": 1}, {"key": "b", "value": 2}].fromEntries()`, |
| 33 | outFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#outFn.: func() *modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value# { |
| 34 | r := modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewMapValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewMapValue().() |
| 35 | _ = r.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("a", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewIntValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewIntValue().(1)) |
| 36 | _ = r.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("b", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewIntValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewIntValue().(2)) |
| 37 | return r |
| 38 | }, |
| 39 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 40 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("roundtrip", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 41 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `{"x": 10, "y": 20}.entries().fromEntries()`, |
| 42 | outFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#outFn.: func() *modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value# { |
| 43 | r := modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewMapValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewMapValue().() |
| 44 | _ = r.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("x", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewIntValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewIntValue().(10)) |
| 45 | _ = r.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("y", modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewIntValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewIntValue().(20)) |
| 46 | return r |
| 47 | }, |
| 48 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 49 | } |