Debian Codegraph @

model/go_value_test.go

raw symbols SCIP
1 package model_testscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/
2
3 import (
4 "github.com/google/go-cmp/cmpscip-go gomod github.com/google/go-cmp v0.7.0 `github.com/google/go-cmp/cmp`/"
5 "github.com/tomwright/dasel/v3/modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/"
6 "testingscip-go gomod github.com/golang/go/src go1.25 testing/"
7 )
8
9 type goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase# struct {
10 inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in. *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 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#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#
12 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp. any
13 }
14
15 func (tc goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#) runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) {
16 if tc.inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#inFn. != nil {
17 tc.inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in. = tc.inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#inFn.()
18 }
19 out, err := tc.inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in..GoValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/Value#GoValue().()
20 if err != nil {
21 t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %v", err)
22 }
23 if !cmpscip-go gomod github.com/google/go-cmp v0.7.0 `github.com/google/go-cmp/cmp`/.Equalscip-go gomod github.com/google/go-cmp v0.7.0 `github.com/google/go-cmp/cmp`/Equal().(tc.expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp., out) {
24 t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("unexpected result: %s", cmpscip-go gomod github.com/google/go-cmp v0.7.0 `github.com/google/go-cmp/cmp`/.Diffscip-go gomod github.com/google/go-cmp v0.7.0 `github.com/google/go-cmp/cmp`/Diff().(tc.expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp., out))
25 }
26 }
27
28 func TestValue_GoValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/TestValue_GoValue().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) {
29 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("null", goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#{
30 inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in.: modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewNullValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewNullValue().(),
31 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp.: nil,
32 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().)
33 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("int", goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#{
34 inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in.: 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),
35 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp.: int64(42),
36 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().)
37 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("float", goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#{
38 inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in.: modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewFloatValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewFloatValue().(3.14),
39 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp.: 3.14,
40 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().)
41 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("string", goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#{
42 inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in.: 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().("hello"),
43 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp.: "hello",
44 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().)
45 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("bool", goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#{
46 inscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#in.: modelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/.NewBoolValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewBoolValue().(true),
47 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp.: true,
48 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().)
49 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("slice", goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#{
50 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#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# {
51 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().()
52 _ = 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))
53 _ = 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))
54 _ = 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))
55 return s
56 },
57 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp.: []any{int64(1), int64(2), int64(3)},
58 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().)
59 t.Runscip-go gomod github.com/golang/go/src go1.25 testing/T#Run().("map", goValueTestCasescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#{
60 inFnscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#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# {
61 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().()
62 _ = m.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`/.NewStringValuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model`/NewStringValue().("apple"))
63 return m
64 },
65 expscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#exp.: map[string]any{
66 "a": "apple",
67 },
68 }.runscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/model_test`/goValueTestCase#run().)
69 }