| 1 | package cli_testscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "bytesscip-go gomod github.com/golang/go/src go1.25 bytes/" |
| 5 | "errorsscip-go gomod github.com/golang/go/src go1.25 errors/" |
| 6 | "osscip-go gomod github.com/golang/go/src go1.25 os/" |
| 7 | "reflectscip-go gomod github.com/golang/go/src go1.25 reflect/" |
| 8 | "testingscip-go gomod github.com/golang/go/src go1.25 testing/" |
| 9 | |
| 10 | "github.com/tomwright/dasel/v3/internal/cliscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/" |
| 11 | ) |
| 12 | |
| 13 | func runDaselscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runDasel().(args []string, in []byte) ([]byte, []byte, error) { |
| 14 | stdOut := bytesscip-go gomod github.com/golang/go/src go1.25 bytes/.NewBufferscip-go gomod github.com/golang/go/src go1.25 bytes/NewBuffer().([]byte{}) |
| 15 | stdErr := bytesscip-go gomod github.com/golang/go/src go1.25 bytes/.NewBufferscip-go gomod github.com/golang/go/src go1.25 bytes/NewBuffer().([]byte{}) |
| 16 | stdIn := bytesscip-go gomod github.com/golang/go/src go1.25 bytes/.NewReaderscip-go gomod github.com/golang/go/src go1.25 bytes/NewReader().(in) |
| 17 | |
| 18 | originalArgs := osscip-go gomod github.com/golang/go/src go1.25 os/.Argsscip-go gomod github.com/golang/go/src go1.25 os/Args. |
| 19 | defer func() { |
| 20 | osscip-go gomod github.com/golang/go/src go1.25 os/.Argsscip-go gomod github.com/golang/go/src go1.25 os/Args. = originalArgs |
| 21 | }() |
| 22 | |
| 23 | osscip-go gomod github.com/golang/go/src go1.25 os/.Argsscip-go gomod github.com/golang/go/src go1.25 os/Args. = append([]string{"dasel", "query"}, args...) |
| 24 | |
| 25 | _, err := cliscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/.Runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/Run().(stdIn, stdOut, stdErr) |
| 26 | |
| 27 | return stdOut.Bytesscip-go gomod github.com/golang/go/src go1.25 bytes/Buffer#Bytes().(), stdErr.Bytesscip-go gomod github.com/golang/go/src go1.25 bytes/Buffer#Bytes().(), err |
| 28 | } |
| 29 | |
| 30 | type testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase# struct { |
| 31 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args. []string |
| 32 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in. []byte |
| 33 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout. []byte |
| 34 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr. []byte |
| 35 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err. error |
| 36 | } |
| 37 | |
| 38 | func runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(tc testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#) func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 39 | return func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 40 | if tc.stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout. == nil { |
| 41 | tc.stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout. = []byte{} |
| 42 | } |
| 43 | if tc.stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr. == nil { |
| 44 | tc.stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr. = []byte{} |
| 45 | } |
| 46 | |
| 47 | gotStdOut, gotStdErr, gotErr := runDaselscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runDasel().(tc.argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args., tc.inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.) |
| 48 | if !errorsscip-go gomod github.com/golang/go/src go1.25 errors/.Isscip-go gomod github.com/golang/go/src go1.25 errors/Is().(gotErr, tc.errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.) && !errorsscip-go gomod github.com/golang/go/src go1.25 errors/.Isscip-go gomod github.com/golang/go/src go1.25 errors/Is().(tc.errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err., gotErr) { |
| 49 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected error %v, got %v", tc.errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err., gotErr) |
| 50 | return |
| 51 | } |
| 52 | |
| 53 | if !reflectscip-go gomod github.com/golang/go/src go1.25 reflect/.DeepEqualscip-go gomod github.com/golang/go/src go1.25 reflect/DeepEqual().(tc.stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr., gotStdErr) { |
| 54 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected stderr %s, got %s", string(tc.stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.), string(gotStdErr)) |
| 55 | } |
| 56 | |
| 57 | if !reflectscip-go gomod github.com/golang/go/src go1.25 reflect/.DeepEqualscip-go gomod github.com/golang/go/src go1.25 reflect/DeepEqual().(tc.stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout., gotStdOut) { |
| 58 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected stdout %s, got %s", string(tc.stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.), string(gotStdOut)) |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | func TestRunscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/TestRun().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 64 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("complex set", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 65 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("set nested with spread", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 66 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--root", `user = {user..., name: {"first": $this.user.name, "last": "Doe"}}`}, |
| 67 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"user": {"name": "John"}}`), |
| 68 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`{ |
| 69 | "user": { |
| 70 | "name": { |
| 71 | "first": "John", |
| 72 | "last": "Doe" |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | `), |
| 77 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 78 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 79 | })) |
| 80 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("set nested", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 81 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--root", `user.name = {"first": user.name, "last": "Doe"}`}, |
| 82 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"user": {"name": "John"}}`), |
| 83 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`{ |
| 84 | "user": { |
| 85 | "name": { |
| 86 | "first": "John", |
| 87 | "last": "Doe" |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | `), |
| 92 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 93 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 94 | })) |
| 95 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("set nested with localised group", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 96 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--root", `user.(name = {"first": name, "last": "Doe"})`}, |
| 97 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"user": {"name": "John"}}`), |
| 98 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`{ |
| 99 | "user": { |
| 100 | "name": { |
| 101 | "first": "John", |
| 102 | "last": "Doe" |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | `), |
| 107 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 108 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 109 | })) |
| 110 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("set recursive descent", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 111 | |
| 112 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("property", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 113 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--root", `$root..x.each($this = $this+1)`}, |
| 114 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`[{"x":1},{"x":2},{"x":3}]`), |
| 115 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 116 | { |
| 117 | "x": 2 |
| 118 | }, |
| 119 | { |
| 120 | "x": 3 |
| 121 | }, |
| 122 | { |
| 123 | "x": 4 |
| 124 | } |
| 125 | ] |
| 126 | `), |
| 127 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 128 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 129 | })) |
| 130 | |
| 131 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("index", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 132 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--root", `$root..[1].each($this = $this+1)`}, |
| 133 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`[ {"x":[1,2,3]} , {"y":[4,5,6]} , {"z":[7,8,9]} ]`), |
| 134 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 135 | { |
| 136 | "x": [ |
| 137 | 1, |
| 138 | 3, |
| 139 | 3 |
| 140 | ] |
| 141 | }, |
| 142 | { |
| 143 | "y": [ |
| 144 | 4, |
| 145 | 6, |
| 146 | 6 |
| 147 | ] |
| 148 | }, |
| 149 | { |
| 150 | "z": [ |
| 151 | 7, |
| 152 | 9, |
| 153 | 9 |
| 154 | ] |
| 155 | } |
| 156 | ] |
| 157 | `), |
| 158 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 159 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 160 | })) |
| 161 | |
| 162 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("wildcard", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 163 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--root", `$root..*.each($this = 4)`}, |
| 164 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`[{"x":1},{"x":2},{"x":3}]`), |
| 165 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 166 | { |
| 167 | "x": 4 |
| 168 | }, |
| 169 | { |
| 170 | "x": 4 |
| 171 | }, |
| 172 | { |
| 173 | "x": 4 |
| 174 | } |
| 175 | ] |
| 176 | `), |
| 177 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 178 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 179 | })) |
| 180 | |
| 181 | }) |
| 182 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("create object with empty stdin", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 183 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{`{"name":"Tom"}`}, |
| 184 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 185 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`{ |
| 186 | "name": "Tom" |
| 187 | } |
| 188 | `), |
| 189 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 190 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 191 | })) |
| 192 | }) |
| 193 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("set search", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 194 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--root", `search(has("x")).each(x = x+1)`}, |
| 195 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`[{"x":1},{"x":2},{"x":3}]`), |
| 196 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 197 | { |
| 198 | "x": 2 |
| 199 | }, |
| 200 | { |
| 201 | "x": 3 |
| 202 | }, |
| 203 | { |
| 204 | "x": 4 |
| 205 | } |
| 206 | ] |
| 207 | `), |
| 208 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 209 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 210 | })) |
| 211 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("recursive descent", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 212 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("wildcard", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 213 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `..*`}, |
| 214 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{ |
| 215 | "user": { |
| 216 | "name": "Alice", |
| 217 | "roles": ["admin", "editor"], |
| 218 | "meta": { |
| 219 | "active": true, |
| 220 | "score": 42 |
| 221 | } |
| 222 | }, |
| 223 | "tags": ["x", "y"], |
| 224 | "count": 10 |
| 225 | }`), |
| 226 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 227 | "Alice", |
| 228 | "admin", |
| 229 | "editor", |
| 230 | true, |
| 231 | 42, |
| 232 | "x", |
| 233 | "y", |
| 234 | 10 |
| 235 | ] |
| 236 | `), |
| 237 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 238 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 239 | })) |
| 240 | |
| 241 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("property", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 242 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `..name`}, |
| 243 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{ |
| 244 | "user": { |
| 245 | "name": "Alice", |
| 246 | "roles": ["admin", "editor"], |
| 247 | "meta": { |
| 248 | "active": true, |
| 249 | "score": 42 |
| 250 | } |
| 251 | }, |
| 252 | "tags": ["x", "y"], |
| 253 | "count": 10 |
| 254 | }`), |
| 255 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 256 | "Alice" |
| 257 | ] |
| 258 | `), |
| 259 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 260 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 261 | })) |
| 262 | |
| 263 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("property2", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 264 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `..name`}, |
| 265 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`[{"name":"Tom"}, {"name":"Jim"}, {"foo": "Bar"}]`), |
| 266 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 267 | "Tom", |
| 268 | "Jim" |
| 269 | ] |
| 270 | `), |
| 271 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 272 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 273 | })) |
| 274 | |
| 275 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("index", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 276 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `..[0]`}, |
| 277 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{ |
| 278 | "user": { |
| 279 | "name": "Alice", |
| 280 | "roles": ["admin", "editor"], |
| 281 | "meta": { |
| 282 | "active": true, |
| 283 | "score": 42 |
| 284 | } |
| 285 | }, |
| 286 | "tags": ["x", "y"], |
| 287 | "count": 10 |
| 288 | }`), |
| 289 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 290 | "admin", |
| 291 | "x" |
| 292 | ] |
| 293 | `), |
| 294 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 295 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 296 | })) |
| 297 | }) |
| 298 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("any", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 299 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("true result", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 300 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `users.any(age > 25)`}, |
| 301 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"users": [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 30}]}`), |
| 302 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("true\n"), |
| 303 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 304 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 305 | })) |
| 306 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("false result", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 307 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `users.any(age > 50)`}, |
| 308 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"users": [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 30}]}`), |
| 309 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("false\n"), |
| 310 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 311 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 312 | })) |
| 313 | }) |
| 314 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("all", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 315 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("true result", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 316 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `users.all(age > 18)`}, |
| 317 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"users": [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 30}]}`), |
| 318 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("true\n"), |
| 319 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 320 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 321 | })) |
| 322 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("false result", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 323 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `users.all(age > 25)`}, |
| 324 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"users": [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 30}]}`), |
| 325 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("false\n"), |
| 326 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 327 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 328 | })) |
| 329 | }) |
| 330 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("ternary", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 331 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("true literal", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 332 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{`true ? "yes" : "no"`}, |
| 333 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 334 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"yes\"\n"), |
| 335 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 336 | })) |
| 337 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("false literal", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 338 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{`false ? "yes" : "no"`}, |
| 339 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 340 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"no\"\n"), |
| 341 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 342 | })) |
| 343 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("with json data true", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 344 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `age >= 18 ? "adult" : "minor"`}, |
| 345 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"age": 25}`), |
| 346 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"adult\"\n"), |
| 347 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 348 | })) |
| 349 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("with json data false", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 350 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `age >= 18 ? "adult" : "minor"`}, |
| 351 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"age": 10}`), |
| 352 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"minor\"\n"), |
| 353 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 354 | })) |
| 355 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("nested ternary", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 356 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{`true ? (false ? "a" : "b") : "c"`}, |
| 357 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 358 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"b\"\n"), |
| 359 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 360 | })) |
| 361 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("with comparison", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 362 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `score >= 90 ? "A" : (score >= 80 ? "B" : "C")`}, |
| 363 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"score": 85}`), |
| 364 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"B\"\n"), |
| 365 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 366 | })) |
| 367 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("ternary in map", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 368 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `items.map(val >= 5 ? "big" : "small")`}, |
| 369 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"items": [{"val": 10}, {"val": 3}, {"val": 7}]}`), |
| 370 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`[ |
| 371 | "big", |
| 372 | "small", |
| 373 | "big" |
| 374 | ] |
| 375 | `), |
| 376 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 377 | })) |
| 378 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("ternary returns number", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 379 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{`true ? 42 : 0`}, |
| 380 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 381 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("42\n"), |
| 382 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 383 | })) |
| 384 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("ternary with arithmetic", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 385 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{`true ? 1 + 2 : 3 + 4`}, |
| 386 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 387 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("3\n"), |
| 388 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 389 | })) |
| 390 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("ternary with logical operators", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 391 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `a > 1 && b > 5 ? "both" : "nope"`}, |
| 392 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"a": 5, "b": 10}`), |
| 393 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"both\"\n"), |
| 394 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 395 | })) |
| 396 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("chained property in condition", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 397 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `user.active ? "yes" : "no"`}, |
| 398 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"user": {"active": true}}`), |
| 399 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("\"yes\"\n"), |
| 400 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 401 | })) |
| 402 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("ternary with json output", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 403 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", `active ? {status: "on"} : {status: "off"}`}, |
| 404 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"active": true}`), |
| 405 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte(`{ |
| 406 | "status": "on" |
| 407 | } |
| 408 | `), |
| 409 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 410 | })) |
| 411 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("ternary returns true", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 412 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{`true ? true : false`}, |
| 413 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 414 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("true\n"), |
| 415 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 416 | })) |
| 417 | }) |
| 418 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("compact", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 419 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("json", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 420 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--compact"}, |
| 421 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"name": "Tom", "age": 30}`), |
| 422 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("{\"name\":\"Tom\",\"age\":30}\n"), |
| 423 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 424 | })) |
| 425 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("json nested", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 426 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", "--compact"}, |
| 427 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"user": {"name": "Tom"}, "items": [1, 2, 3]}`), |
| 428 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("{\"user\":{\"name\":\"Tom\"},\"items\":[1,2,3]}\n"), |
| 429 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 430 | })) |
| 431 | }) |
| 432 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("merge", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 433 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("deep", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 434 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", "-o", "json", |
| 435 | `merge({"a": {"x": 1, "y": 2}}, {"a": {"y": 3, "z": 4}})`}, |
| 436 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte{}, |
| 437 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("{\n \"a\": {\n \"x\": 1,\n \"y\": 3,\n \"z\": 4\n }\n}\n"), |
| 438 | })) |
| 439 | }) |
| 440 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("count", func(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 441 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("some match", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 442 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `users.count(age > 25)`}, |
| 443 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"users": [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 30}, {"name": "Charlie", "age": 35}]}`), |
| 444 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("2\n"), |
| 445 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 446 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 447 | })) |
| 448 | t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("none match", runTestscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/runTest().(testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#{ |
| 449 | argsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#args.: []string{"-i", "json", `users.count(age > 50)`}, |
| 450 | inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#in.: []byte(`{"users": [{"name": "Alice", "age": 20}, {"name": "Bob", "age": 30}]}`), |
| 451 | stdoutscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stdout.: []byte("0\n"), |
| 452 | stderrscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#stderr.: nil, |
| 453 | errscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli_test`/testCase#err.: nil, |
| 454 | })) |
| 455 | }) |
| 456 | } |