Debian Codegraph @

execution/execute_array_test.go

raw symbols SCIP
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 TestArrayscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/TestArray().(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 inSlice := 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# {
11 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().()
12 if err := 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().(1)); err != nil {
13 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
14 }
15 if err := 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().(2)); err != nil {
16 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
17 }
18 if err := 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().(3)); err != nil {
19 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
20 }
21 return s
22 }
23 inMap := 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# {
24 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().()
25 if err := m.SetMapKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#SetMapKey().("numbers", inSlice()); err != nil {
26 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
27 }
28 return m
29 }
30
31 runArrayTests := func(in 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#, prefix string) 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#) {
32 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#) {
33 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("1:2", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{
34 sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: prefix + `[1:2]`,
35 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: in,
36 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# {
37 res := 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().()
38 if err := res.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().(2)); err != nil {
39 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
40 }
41 if err := res.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().(3)); err != nil {
42 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
43 }
44 return res
45 },
46 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().)
47 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("1:0", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{
48 sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: prefix + `[1:0]`,
49 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: in,
50 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# {
51 res := 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().()
52 if err := res.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().(2)); err != nil {
53 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
54 }
55 if err := res.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().(1)); err != nil {
56 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
57 }
58 return res
59 },
60 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().)
61 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("1:", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{
62 sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: prefix + `[1:]`,
63 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: in,
64 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# {
65 res := 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().()
66 if err := res.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().(2)); err != nil {
67 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
68 }
69 if err := res.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().(3)); err != nil {
70 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
71 }
72 return res
73 },
74 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().)
75 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().(":1", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{
76 sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: prefix + `[:1]`,
77 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: in,
78 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# {
79 res := 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().()
80 if err := res.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().(1)); err != nil {
81 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
82 }
83 if err := res.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().(2)); err != nil {
84 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
85 }
86 return res
87 },
88 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().)
89 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("reverse", testCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#{
90 sscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#s.: prefix + `[len($this)-1:0]`,
91 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#inFn.: in,
92 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# {
93 res := 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().()
94 if err := res.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().(3)); err != nil {
95 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
96 }
97 if err := res.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().(2)); err != nil {
98 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
99 }
100 if err := res.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().(1)); err != nil {
101 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %s", err)
102 }
103 return res
104 },
105 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/execution_test`/testCase#run().)
106 }
107 }
108
109 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("direct to slice", runArrayTests(inSlice, "$this"))
110 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("property to slice", runArrayTests(inMap, "numbers"))
111 }