| 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 | "github.com/tomwright/dasel/v3/model/orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/" |
| 8 | ) |
| 9 | |
| 10 | func TestSearchscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/TestSearch().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 11 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("search has key in nested map", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 12 | inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: 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 | return modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewValue().( |
| 14 | orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().(). |
| 15 | Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("a", orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().(). |
| 16 | Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("x", 1)). |
| 17 | Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("b", orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().(). |
| 18 | Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("y", 2)), |
| 19 | ) |
| 20 | }, |
| 21 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `search(has("x"))`, |
| 22 | 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# { |
| 23 | s := 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().() |
| 24 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewValue().(orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("x", 1))) |
| 25 | return s |
| 26 | }, |
| 27 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 28 | |
| 29 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("search on array of objects", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 30 | inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: 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# { |
| 31 | return modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewValue().([]any{ |
| 32 | orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("name", "alice"), |
| 33 | orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("name", "bob"), |
| 34 | orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("name", "alice"), |
| 35 | }) |
| 36 | }, |
| 37 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `search(name == "alice")`, |
| 38 | 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# { |
| 39 | s := 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().() |
| 40 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewValue().(orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("name", "alice"))) |
| 41 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewValue().(orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("name", "alice"))) |
| 42 | return s |
| 43 | }, |
| 44 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 45 | |
| 46 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("search with $key on map", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 47 | inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: 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# { |
| 48 | m := 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().() |
| 49 | _ = m.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("other", 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)) |
| 50 | _ = m.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("target", 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().(42)) |
| 51 | return m |
| 52 | }, |
| 53 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `search($key == "target")`, |
| 54 | 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# { |
| 55 | s := 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().() |
| 56 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(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().(42)) |
| 57 | return s |
| 58 | }, |
| 59 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 60 | |
| 61 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("search with $key on slice", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 62 | inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: 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# { |
| 63 | s := 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().() |
| 64 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(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)) |
| 65 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(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)) |
| 66 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(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().(30)) |
| 67 | return s |
| 68 | }, |
| 69 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `search($key == 1)`, |
| 70 | 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# { |
| 71 | s := 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().() |
| 72 | _ = s.Appendscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#Append().(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)) |
| 73 | return s |
| 74 | }, |
| 75 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 76 | |
| 77 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("no matches returns empty", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{ |
| 78 | inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: 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# { |
| 79 | return modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewValue().([]any{ |
| 80 | orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("name", "alice"), |
| 81 | orderedmapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/.NewMapscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/NewMap().().Setscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model/orderedmap`/Map#Set().("name", "bob"), |
| 82 | }) |
| 83 | }, |
| 84 | sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: `search(name == "charlie")`, |
| 85 | 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# { |
| 86 | return 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().() |
| 87 | }, |
| 88 | }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().) |
| 89 | } |