| 1 | package internalscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/ |
| 2 | |
| 3 | import ( |
| 4 | "mathscip-go gomod github.com/golang/go/src go1.25 math/" |
| 5 | "stringsscip-go gomod github.com/golang/go/src go1.25 strings/" |
| 6 | "testingscip-go gomod github.com/golang/go/src go1.25 testing/" |
| 7 | ) |
| 8 | |
| 9 | // Tests based on the official KDL v2 spec test suite: |
| 10 | // https://github.com/kdl-org/kdl/tree/main/tests/test_cases |
| 11 | |
| 12 | // --- Successful parse tests (from official test suite input → expected) --- |
| 13 | |
| 14 | func TestSpecV2_Emptyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Empty().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 15 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("") |
| 16 | if err != nil { |
| 17 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 18 | } |
| 19 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 0) |
| 20 | } |
| 21 | |
| 22 | func TestSpecV2_JustNodeIDscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_JustNodeID().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 23 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node") |
| 24 | if err != nil { |
| 25 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 26 | } |
| 27 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 28 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node") |
| 29 | } |
| 30 | |
| 31 | func TestSpecV2_TwoNodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_TwoNodes().(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 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node1\nnode2") |
| 33 | if err != nil { |
| 34 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 35 | } |
| 36 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 2) |
| 37 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node1") |
| 38 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[1], "node2") |
| 39 | } |
| 40 | |
| 41 | func TestSpecV2_AllNodeFieldsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_AllNodeFields().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 42 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node arg prop=val {\n inner_node\n}") |
| 43 | if err != nil { |
| 44 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 45 | } |
| 46 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 47 | n := doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0] |
| 48 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, n, "node") |
| 49 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, n, 1) |
| 50 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, n, 0, "arg") |
| 51 | assertPropCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropCount().(t, n, 1) |
| 52 | assertPropStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropString().(t, n, "prop", "val") |
| 53 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, n, 1) |
| 54 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, n.Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.[0], "inner_node") |
| 55 | } |
| 56 | |
| 57 | func TestSpecV2_BooleanArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BooleanArg().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 58 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node #false #true") |
| 59 | if err != nil { |
| 60 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 61 | } |
| 62 | n := doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0] |
| 63 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, n, 2) |
| 64 | assertArgBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgBool().(t, n, 0, false) |
| 65 | assertArgBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgBool().(t, n, 1, true) |
| 66 | } |
| 67 | |
| 68 | func TestSpecV2_BooleanPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BooleanProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 69 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node prop1=#true prop2=#false") |
| 70 | if err != nil { |
| 71 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 72 | } |
| 73 | n := doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0] |
| 74 | assertPropBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropBool().(t, n, "prop1", true) |
| 75 | assertPropBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropBool().(t, n, "prop2", false) |
| 76 | } |
| 77 | |
| 78 | func TestSpecV2_NullArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NullArg().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 79 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node #null") |
| 80 | if err != nil { |
| 81 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 82 | } |
| 83 | assertArgNullscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgNull().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 84 | } |
| 85 | |
| 86 | func TestSpecV2_NullPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NullProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 87 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node prop=#null") |
| 88 | if err != nil { |
| 89 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 90 | } |
| 91 | assertPropNullscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropNull().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "prop") |
| 92 | } |
| 93 | |
| 94 | func TestSpecV2_StringArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_StringArg().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 95 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`node "arg"`) |
| 96 | if err != nil { |
| 97 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 98 | } |
| 99 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 100 | } |
| 101 | |
| 102 | func TestSpecV2_StringPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_StringProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 103 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`node prop="val"`) |
| 104 | if err != nil { |
| 105 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 106 | } |
| 107 | assertPropStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "prop", "val") |
| 108 | } |
| 109 | |
| 110 | func TestSpecV2_EmptyStringArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_EmptyStringArg().(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 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`node ""`) |
| 112 | if err != nil { |
| 113 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 114 | } |
| 115 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "") |
| 116 | } |
| 117 | |
| 118 | func TestSpecV2_SingleArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SingleArg().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 119 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node arg") |
| 120 | if err != nil { |
| 121 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 122 | } |
| 123 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 124 | } |
| 125 | |
| 126 | func TestSpecV2_SinglePropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SingleProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 127 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node prop=val") |
| 128 | if err != nil { |
| 129 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 130 | } |
| 131 | assertPropStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "prop", "val") |
| 132 | } |
| 133 | |
| 134 | func TestSpecV2_ArgAndPropSameNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_ArgAndPropSameName().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 135 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node arg arg=val") |
| 136 | if err != nil { |
| 137 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 138 | } |
| 139 | n := doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0] |
| 140 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, n, 1) |
| 141 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, n, 0, "arg") |
| 142 | assertPropCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropCount().(t, n, 1) |
| 143 | assertPropStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropString().(t, n, "arg", "val") |
| 144 | } |
| 145 | |
| 146 | func TestSpecV2_NumericArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NumericArg().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 147 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 15.7") |
| 148 | if err != nil { |
| 149 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 150 | } |
| 151 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 15.7) |
| 152 | } |
| 153 | |
| 154 | func TestSpecV2_NumericPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NumericProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 155 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node prop=10.0") |
| 156 | if err != nil { |
| 157 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 158 | } |
| 159 | assertPropFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "prop", 10.0) |
| 160 | } |
| 161 | |
| 162 | func TestSpecV2_Binaryscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Binary().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 163 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 0b10") |
| 164 | if err != nil { |
| 165 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 166 | } |
| 167 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 2) |
| 168 | } |
| 169 | |
| 170 | func TestSpecV2_Hexscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Hex().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 171 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 0xff") |
| 172 | if err != nil { |
| 173 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 174 | } |
| 175 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 255) |
| 176 | } |
| 177 | |
| 178 | func TestSpecV2_Octalscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Octal().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 179 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 0o77") |
| 180 | if err != nil { |
| 181 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 182 | } |
| 183 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 63) |
| 184 | } |
| 185 | |
| 186 | func TestSpecV2_NegativeIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NegativeInt().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 187 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node -10 prop=-15") |
| 188 | if err != nil { |
| 189 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 190 | } |
| 191 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, -10) |
| 192 | assertPropIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "prop", -15) |
| 193 | } |
| 194 | |
| 195 | func TestSpecV2_PositiveIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_PositiveInt().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 196 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node +10") |
| 197 | if err != nil { |
| 198 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 199 | } |
| 200 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 10) |
| 201 | } |
| 202 | |
| 203 | func TestSpecV2_NegativeFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NegativeFloat().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 204 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node -1.0 key=-10.0") |
| 205 | if err != nil { |
| 206 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 207 | } |
| 208 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, -1.0) |
| 209 | assertPropFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "key", -10.0) |
| 210 | } |
| 211 | |
| 212 | func TestSpecV2_ZeroIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_ZeroInt().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 213 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 0") |
| 214 | if err != nil { |
| 215 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 216 | } |
| 217 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 0) |
| 218 | } |
| 219 | |
| 220 | func TestSpecV2_ZeroFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_ZeroFloat().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 221 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 0.0") |
| 222 | if err != nil { |
| 223 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 224 | } |
| 225 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 0.0) |
| 226 | } |
| 227 | |
| 228 | func TestSpecV2_PositiveExponentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_PositiveExponent().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 229 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 1.0e+10") |
| 230 | if err != nil { |
| 231 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 232 | } |
| 233 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 1.0e+10) |
| 234 | } |
| 235 | |
| 236 | func TestSpecV2_NegativeExponentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NegativeExponent().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 237 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 1.0e-10") |
| 238 | if err != nil { |
| 239 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 240 | } |
| 241 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 1.0e-10) |
| 242 | } |
| 243 | |
| 244 | func TestSpecV2_NoDecimalExponentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NoDecimalExponent().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 245 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 1e10") |
| 246 | if err != nil { |
| 247 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 248 | } |
| 249 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 1e10) |
| 250 | } |
| 251 | |
| 252 | func TestSpecV2_UnderscoreInIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_UnderscoreInInt().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 253 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 1_0") |
| 254 | if err != nil { |
| 255 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 256 | } |
| 257 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 10) |
| 258 | } |
| 259 | |
| 260 | func TestSpecV2_UnderscoreInFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_UnderscoreInFloat().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 261 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 1_1.0") |
| 262 | if err != nil { |
| 263 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 264 | } |
| 265 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 11.0) |
| 266 | } |
| 267 | |
| 268 | func TestSpecV2_FloatingPointKeywordsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_FloatingPointKeywords().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 269 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("floats #inf #-inf #nan") |
| 270 | if err != nil { |
| 271 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 272 | } |
| 273 | n := doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0] |
| 274 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, n, 3) |
| 275 | |
| 276 | v0, ok := n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[0].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(float64) |
| 277 | if !ok || !mathscip-go gomod github.com/golang/go/src go1.25 math/.IsInfscip-go gomod github.com/golang/go/src go1.25 math/IsInf().(v0, 1) { |
| 278 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected +inf, got %v", n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[0].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 279 | } |
| 280 | v1, ok := n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[1].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(float64) |
| 281 | if !ok || !mathscip-go gomod github.com/golang/go/src go1.25 math/.IsInfscip-go gomod github.com/golang/go/src go1.25 math/IsInf().(v1, -1) { |
| 282 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected -inf, got %v", n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[1].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 283 | } |
| 284 | v2, ok := n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[2].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(float64) |
| 285 | if !ok || !mathscip-go gomod github.com/golang/go/src go1.25 math/.IsNaNscip-go gomod github.com/golang/go/src go1.25 math/IsNaN().(v2) { |
| 286 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected NaN, got %v", n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[2].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | func TestSpecV2_Emojiscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Emoji().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 291 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node 😀") |
| 292 | if err != nil { |
| 293 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 294 | } |
| 295 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "😀") |
| 296 | } |
| 297 | |
| 298 | func TestSpecV2_BareEmojiscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BareEmoji().(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 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("😁 happy!") |
| 300 | if err != nil { |
| 301 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 302 | } |
| 303 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "😁") |
| 304 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "happy!") |
| 305 | } |
| 306 | |
| 307 | func TestSpecV2_QuotedNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_QuotedNodeName().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 308 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`"0node"`) |
| 309 | if err != nil { |
| 310 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 311 | } |
| 312 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "0node") |
| 313 | } |
| 314 | |
| 315 | func TestSpecV2_EmptyQuotedNodeIDscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_EmptyQuotedNodeID().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 316 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`""`) |
| 317 | if err != nil { |
| 318 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 319 | } |
| 320 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "") |
| 321 | } |
| 322 | |
| 323 | func TestSpecV2_EmptyQuotedPropKeyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_EmptyQuotedPropKey().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 324 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`node ""=#true`) |
| 325 | if err != nil { |
| 326 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 327 | } |
| 328 | assertPropBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropBool().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "", true) |
| 329 | } |
| 330 | |
| 331 | func TestSpecV2_NodeTypescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NodeType().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 332 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("(type)node") |
| 333 | if err != nil { |
| 334 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 335 | } |
| 336 | if doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Typescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Type. != "type" { |
| 337 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected type 'type', got %q", doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Typescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Type.) |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | func TestSpecV2_ArgTypescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_ArgType().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 342 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node (type)arg") |
| 343 | if err != nil { |
| 344 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 345 | } |
| 346 | if doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[0].Typescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Type. != "type" { |
| 347 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected arg type 'type', got %q", doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[0].Typescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Type.) |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | func TestSpecV2_PropTypescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_PropType().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 352 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node key=(type)#true") |
| 353 | if err != nil { |
| 354 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 355 | } |
| 356 | if doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties.[0].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Typescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Type. != "type" { |
| 357 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected prop type 'type', got %q", doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties.[0].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Typescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Type.) |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | func TestSpecV2_NestedChildrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NestedChildren().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 362 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node1 {\n node2 {\n node\n }\n}") |
| 363 | if err != nil { |
| 364 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 365 | } |
| 366 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 367 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 1) |
| 368 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.[0], 1) |
| 369 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.[0].Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.[0], "node") |
| 370 | } |
| 371 | |
| 372 | func TestSpecV2_EmptyChildscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_EmptyChild().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 373 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node {\n}") |
| 374 | if err != nil { |
| 375 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 376 | } |
| 377 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 378 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 379 | } |
| 380 | |
| 381 | func TestSpecV2_EmptyChildSameLinescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_EmptyChildSameLine().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 382 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node {}") |
| 383 | if err != nil { |
| 384 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 385 | } |
| 386 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 387 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 388 | } |
| 389 | |
| 390 | func TestSpecV2_PreserveDuplicateNodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_PreserveDuplicateNodes().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 391 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node\nnode") |
| 392 | if err != nil { |
| 393 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 394 | } |
| 395 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 2) |
| 396 | } |
| 397 | |
| 398 | func TestSpecV2_PreserveNodeOrderscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_PreserveNodeOrder().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 399 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node2\nnode5\nnode1") |
| 400 | if err != nil { |
| 401 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 402 | } |
| 403 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 3) |
| 404 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node2") |
| 405 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[1], "node5") |
| 406 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[2], "node1") |
| 407 | } |
| 408 | |
| 409 | func TestSpecV2_SameNameNodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SameNameNodes().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 410 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node\nnode") |
| 411 | if err != nil { |
| 412 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 413 | } |
| 414 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 2) |
| 415 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node") |
| 416 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[1], "node") |
| 417 | } |
| 418 | |
| 419 | // --- Semicolons --- |
| 420 | |
| 421 | func TestSpecV2_SemicolonSeparatedscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SemicolonSeparated().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 422 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node1;node2") |
| 423 | if err != nil { |
| 424 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 425 | } |
| 426 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 2) |
| 427 | } |
| 428 | |
| 429 | func TestSpecV2_SemicolonSeparatedNodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SemicolonSeparatedNodes().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 430 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node1; node2; ") |
| 431 | if err != nil { |
| 432 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 433 | } |
| 434 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 2) |
| 435 | } |
| 436 | |
| 437 | func TestSpecV2_OptionalChildSemicolonscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_OptionalChildSemicolon().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 438 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node {foo;bar;baz}") |
| 439 | if err != nil { |
| 440 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 441 | } |
| 442 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 3) |
| 443 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.[0], "foo") |
| 444 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.[1], "bar") |
| 445 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.[2], "baz") |
| 446 | } |
| 447 | |
| 448 | // --- Comments --- |
| 449 | |
| 450 | func TestSpecV2_BlockCommentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BlockComment().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 451 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /* comment */ arg") |
| 452 | if err != nil { |
| 453 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 454 | } |
| 455 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 456 | } |
| 457 | |
| 458 | func TestSpecV2_BlockCommentAfterNodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BlockCommentAfterNode().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 459 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /* hey */ arg") |
| 460 | if err != nil { |
| 461 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 462 | } |
| 463 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 464 | } |
| 465 | |
| 466 | func TestSpecV2_NestedBlockCommentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NestedBlockComment().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 467 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /* hi /* there */ everyone */ arg") |
| 468 | if err != nil { |
| 469 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 470 | } |
| 471 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 472 | } |
| 473 | |
| 474 | func TestSpecV2_NestedCommentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NestedComments().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 475 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /*/* nested */*/ arg") |
| 476 | if err != nil { |
| 477 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 478 | } |
| 479 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 480 | } |
| 481 | |
| 482 | func TestSpecV2_JustBlockCommentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_JustBlockComment().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 483 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("/* hey */") |
| 484 | if err != nil { |
| 485 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 486 | } |
| 487 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 0) |
| 488 | } |
| 489 | |
| 490 | // --- Slashdash --- |
| 491 | |
| 492 | func TestSpecV2_CommentedArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_CommentedArg().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 493 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /- arg1 arg2") |
| 494 | if err != nil { |
| 495 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 496 | } |
| 497 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 1) |
| 498 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg2") |
| 499 | } |
| 500 | |
| 501 | func TestSpecV2_CommentedPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_CommentedProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 502 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /- prop=val arg") |
| 503 | if err != nil { |
| 504 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 505 | } |
| 506 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 1) |
| 507 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 508 | assertPropCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 509 | } |
| 510 | |
| 511 | func TestSpecV2_CommentedNodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_CommentedNode().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 512 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("/- node_1\nnode_2\n/- node_3") |
| 513 | if err != nil { |
| 514 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 515 | } |
| 516 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 517 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node_2") |
| 518 | } |
| 519 | |
| 520 | func TestSpecV2_CommentedChildscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_CommentedChild().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 521 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node arg /- {\n inner_node\n}") |
| 522 | if err != nil { |
| 523 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 524 | } |
| 525 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 1) |
| 526 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 527 | } |
| 528 | |
| 529 | func TestSpecV2_SlashDashChildscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SlashDashChild().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 530 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /- {\n node2\n}") |
| 531 | if err != nil { |
| 532 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 533 | } |
| 534 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 535 | } |
| 536 | |
| 537 | func TestSpecV2_SlashDashEmptyChildscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SlashDashEmptyChild().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 538 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /- {\n}") |
| 539 | if err != nil { |
| 540 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 541 | } |
| 542 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 543 | } |
| 544 | |
| 545 | func TestSpecV2_SlashDashNodeInChildscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SlashDashNodeInChild().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 546 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node1 {\n /- node2\n}") |
| 547 | if err != nil { |
| 548 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 549 | } |
| 550 | assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 551 | } |
| 552 | |
| 553 | func TestSpecV2_SlashDashPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SlashDashProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 554 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /- key=value arg") |
| 555 | if err != nil { |
| 556 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 557 | } |
| 558 | assertPropCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0) |
| 559 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 1) |
| 560 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 561 | } |
| 562 | |
| 563 | func TestSpecV2_SlashDashNegativeNumberscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_SlashDashNegativeNumber().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 564 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node /--1.0 2.0") |
| 565 | if err != nil { |
| 566 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 567 | } |
| 568 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 1) |
| 569 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, 2.0) |
| 570 | } |
| 571 | |
| 572 | func TestSpecV2_InitialSlashDashscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_InitialSlashDash().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 573 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("/-node here\nanother-node") |
| 574 | if err != nil { |
| 575 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 576 | } |
| 577 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 578 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "another-node") |
| 579 | } |
| 580 | |
| 581 | // --- Line continuations --- |
| 582 | |
| 583 | func TestSpecV2_Esclinescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Escline().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 584 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node \\\n arg") |
| 585 | if err != nil { |
| 586 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 587 | } |
| 588 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 589 | } |
| 590 | |
| 591 | func TestSpecV2_EsclineNodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_EsclineNode().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 592 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node1\n\\\nnode2") |
| 593 | if err != nil { |
| 594 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 595 | } |
| 596 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 2) |
| 597 | } |
| 598 | |
| 599 | func TestSpecV2_MultilineNodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_MultilineNodes().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 600 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node \\\n arg1 \\\n arg2") |
| 601 | if err != nil { |
| 602 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 603 | } |
| 604 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 2) |
| 605 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg1") |
| 606 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 1, "arg2") |
| 607 | } |
| 608 | |
| 609 | // --- Raw strings (v2 syntax: #"..."#) --- |
| 610 | |
| 611 | func TestSpecV2_RawStringArgscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_RawStringArg().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 612 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node_1 #\"\"arg\n\"and #stuff\"#\nnode_2 ##\"#\"arg\n\"#and #stuff\"##") |
| 613 | if err != nil { |
| 614 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 615 | } |
| 616 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "\"arg\n\"and #stuff") |
| 617 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[1], 0, "#\"arg\n\"#and #stuff") |
| 618 | } |
| 619 | |
| 620 | func TestSpecV2_RawStringPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_RawStringProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 621 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node_1 prop=#\"\"arg#\"\n\"#\nnode_2 prop=##\"#\"arg#\"#\n\"##") |
| 622 | if err != nil { |
| 623 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 624 | } |
| 625 | assertPropStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "prop", "\"arg#\"\n") |
| 626 | assertPropStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[1], "prop", "#\"arg#\"#\n") |
| 627 | } |
| 628 | |
| 629 | func TestSpecV2_RawStringBackslashscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_RawStringBackslash().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 630 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node #\"\n\"#") |
| 631 | if err != nil { |
| 632 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 633 | } |
| 634 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "\n") |
| 635 | } |
| 636 | |
| 637 | func TestSpecV2_RawStringHashNoEscscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_RawStringHashNoEsc().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 638 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node #\"#\"#") |
| 639 | if err != nil { |
| 640 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 641 | } |
| 642 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "#") |
| 643 | } |
| 644 | |
| 645 | // --- Multi-line strings --- |
| 646 | |
| 647 | func TestSpecV2_MultiLineStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_MultiLineString().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 648 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node \"\"\"\nhey\neveryone\nhow goes?\n\"\"\"") |
| 649 | if err != nil { |
| 650 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 651 | } |
| 652 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "hey\neveryone\nhow goes?") |
| 653 | } |
| 654 | |
| 655 | func TestSpecV2_MultiLineStringIndentedscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_MultiLineStringIndented().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 656 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node \"\"\"\n hey\n everyone\n how goes?\n \"\"\"") |
| 657 | if err != nil { |
| 658 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 659 | } |
| 660 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, " hey\n everyone\n how goes?") |
| 661 | } |
| 662 | |
| 663 | func TestSpecV2_MultiLineRawStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_MultiLineRawString().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 664 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node #\"\"\"\nhey\neveryone\nhow goes?\n\"\"\"#") |
| 665 | if err != nil { |
| 666 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 667 | } |
| 668 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "hey\neveryone\nhow goes?") |
| 669 | } |
| 670 | |
| 671 | func TestSpecV2_MultiLineRawStringIndentedscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_MultiLineRawStringIndented().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 672 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node #\"\"\"\n hey\n everyone\n how goes?\n \"\"\"#") |
| 673 | if err != nil { |
| 674 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 675 | } |
| 676 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, " hey\n everyone\n how goes?") |
| 677 | } |
| 678 | |
| 679 | // --- Escapes --- |
| 680 | |
| 681 | func TestSpecV2_AllEscapesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_AllEscapes().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 682 | // v2 escape: \s means space |
| 683 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node \"\\\"\\\\\t\\s\"") |
| 684 | if err != nil { |
| 685 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 686 | } |
| 687 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "\"\\\t ") |
| 688 | } |
| 689 | |
| 690 | func TestSpecV2_UnicodeEscapeInStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_UnicodeEscapeInString().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 691 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`node "\u{10FFFF}"`) |
| 692 | if err != nil { |
| 693 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 694 | } |
| 695 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "\U0010FFFF") |
| 696 | } |
| 697 | |
| 698 | // --- Bare identifiers --- |
| 699 | |
| 700 | func TestSpecV2_DashDashscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_DashDash().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 701 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node --") |
| 702 | if err != nil { |
| 703 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 704 | } |
| 705 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "--") |
| 706 | } |
| 707 | |
| 708 | func TestSpecV2_BareIdentSignscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BareIdentSign().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 709 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node +") |
| 710 | if err != nil { |
| 711 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 712 | } |
| 713 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "+") |
| 714 | } |
| 715 | |
| 716 | func TestSpecV2_BareIdentDotscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BareIdentDot().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 717 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node .") |
| 718 | if err != nil { |
| 719 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 720 | } |
| 721 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, ".") |
| 722 | } |
| 723 | |
| 724 | func TestSpecV2_BareIdentSignDotscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_BareIdentSignDot().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 725 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node +.") |
| 726 | if err != nil { |
| 727 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 728 | } |
| 729 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "+.") |
| 730 | } |
| 731 | |
| 732 | func TestSpecV2_TruePrefixInBareIDscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_TruePrefixInBareID().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 733 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("true_id") |
| 734 | if err != nil { |
| 735 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 736 | } |
| 737 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "true_id") |
| 738 | } |
| 739 | |
| 740 | func TestSpecV2_FalsePrefixInBareIDscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_FalsePrefixInBareID().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 741 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("false_id") |
| 742 | if err != nil { |
| 743 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 744 | } |
| 745 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "false_id") |
| 746 | } |
| 747 | |
| 748 | func TestSpecV2_NullPrefixInBareIDscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NullPrefixInBareID().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 749 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("null_id") |
| 750 | if err != nil { |
| 751 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 752 | } |
| 753 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "null_id") |
| 754 | } |
| 755 | |
| 756 | func TestSpecV2_QuestionMarkBeforeNumberscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_QuestionMarkBeforeNumber().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 757 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node ?15") |
| 758 | if err != nil { |
| 759 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 760 | } |
| 761 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "?15") |
| 762 | } |
| 763 | |
| 764 | func TestSpecV2_RNodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_RNode().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 765 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`r "arg"`) |
| 766 | if err != nil { |
| 767 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 768 | } |
| 769 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "r") |
| 770 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], 0, "arg") |
| 771 | } |
| 772 | |
| 773 | func TestSpecV2_NodeFalsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NodeFalse().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 774 | // In v2, bare `false` is disallowed as node name; this is the v2 form |
| 775 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node_false") |
| 776 | if err != nil { |
| 777 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 778 | } |
| 779 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node_false") |
| 780 | } |
| 781 | |
| 782 | func TestSpecV2_NodeTruescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_NodeTrue().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 783 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node_true") |
| 784 | if err != nil { |
| 785 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 786 | } |
| 787 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node_true") |
| 788 | } |
| 789 | |
| 790 | // --- Repeated property (last wins) --- |
| 791 | |
| 792 | func TestSpecV2_RepeatedPropscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_RepeatedProp().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 793 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node prop=10 prop=11") |
| 794 | if err != nil { |
| 795 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 796 | } |
| 797 | // Both appear in our AST (spec says last wins at semantic level) |
| 798 | n := doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0] |
| 799 | assertPropCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropCount().(t, n, 2) |
| 800 | // Second property overrides first semantically |
| 801 | assertPropIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropInt().(t, n, "prop", 11) |
| 802 | } |
| 803 | |
| 804 | // --- Parse all arg types --- |
| 805 | |
| 806 | func TestSpecV2_ParseAllArgTypesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_ParseAllArgTypes().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 807 | input := `node 1 1.0 1.0e10 1.0e-10 0x01 0o07 0b10 arg "arg" #"arg\\"# #true #false #null` |
| 808 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(input) |
| 809 | if err != nil { |
| 810 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 811 | } |
| 812 | n := doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0] |
| 813 | assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t, n, 13) |
| 814 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, n, 0, 1) // 1 |
| 815 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, n, 1, 1.0) // 1.0 |
| 816 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, n, 2, 1.0e10) // 1.0e10 |
| 817 | assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t, n, 3, 1.0e-10) // 1.0e-10 |
| 818 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, n, 4, 1) // 0x01 |
| 819 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, n, 5, 7) // 0o07 |
| 820 | assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t, n, 6, 2) // 0b10 |
| 821 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, n, 7, "arg") // bare arg |
| 822 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, n, 8, "arg") // "arg" |
| 823 | assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t, n, 9, "arg\\\\") // #"arg\\"# (raw, no escape processing) |
| 824 | assertArgBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgBool().(t, n, 10, true) // #true |
| 825 | assertArgBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgBool().(t, n, 11, false) // #false |
| 826 | assertArgNullscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgNull().(t, n, 12) // #null |
| 827 | } |
| 828 | |
| 829 | // --- Whitespace and newlines --- |
| 830 | |
| 831 | func TestSpecV2_LeadingNewlinescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_LeadingNewline().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 832 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("\nnode") |
| 833 | if err != nil { |
| 834 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 835 | } |
| 836 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 837 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node") |
| 838 | } |
| 839 | |
| 840 | func TestSpecV2_TrailingCRLFscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_TrailingCRLF().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 841 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node\r\n") |
| 842 | if err != nil { |
| 843 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 844 | } |
| 845 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 846 | } |
| 847 | |
| 848 | func TestSpecV2_CRLFBetweenNodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_CRLFBetweenNodes().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 849 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("node1\r\nnode2") |
| 850 | if err != nil { |
| 851 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 852 | } |
| 853 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 2) |
| 854 | } |
| 855 | |
| 856 | func TestSpecV2_JustNewlinescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_JustNewline().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 857 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("\n") |
| 858 | if err != nil { |
| 859 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 860 | } |
| 861 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 0) |
| 862 | } |
| 863 | |
| 864 | // --- Version marker --- |
| 865 | |
| 866 | func TestSpecV2_VersionMarkerV2scip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_VersionMarkerV2().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 867 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("/- kdl-version 2\nnode #true") |
| 868 | if err != nil { |
| 869 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 870 | } |
| 871 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 872 | assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t, doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0], "node") |
| 873 | } |
| 874 | |
| 875 | func TestSpecV2_VersionMarkerV1scip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_VersionMarkerV1().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 876 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("/- kdl-version 1\nnode true") |
| 877 | if err != nil { |
| 878 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 879 | } |
| 880 | assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t, doc, 1) |
| 881 | } |
| 882 | |
| 883 | func TestSpecV2_VersionMarkerUnrecognizedscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_VersionMarkerUnrecognized().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 884 | _, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("/- kdl-version 3\nnode true") |
| 885 | if err == nil { |
| 886 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().("expected error for unrecognized version 3") |
| 887 | } |
| 888 | if !stringsscip-go gomod github.com/golang/go/src go1.25 strings/.Containsscip-go gomod github.com/golang/go/src go1.25 strings/Contains().(err.Error(), "unsupported version") { |
| 889 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected unsupported version error, got: %v", err) |
| 890 | } |
| 891 | } |
| 892 | |
| 893 | // --- Fail cases (should produce parse errors) --- |
| 894 | |
| 895 | func TestSpecV2_Fail_LegacyRawStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Fail_LegacyRawString().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 896 | // v2 does not support r"..." raw strings |
| 897 | tok := NewTokenizerscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/NewTokenizer().(`r"foo"`) |
| 898 | tok.Versionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Tokenizer#Version. = Version2scip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Version2. |
| 899 | // r followed by " should parse r as identifier, then "foo" as separate string |
| 900 | // This should NOT produce a raw string token when version is v2 |
| 901 | token, err := tok.NextTokenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Tokenizer#NextToken().() |
| 902 | if err != nil { |
| 903 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().(err) |
| 904 | } |
| 905 | // In v2, `r` is just a bare identifier, `"foo"` is a separate string |
| 906 | if token.Typescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Token#Type. != TokenIdentifierscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TokenIdentifier. || token.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Token#Value. != "r" { |
| 907 | // Our tokenizer handles both v1/v2, so r"..." is accepted at token level |
| 908 | // The spec says this should be a parse error in strict v2 mode. |
| 909 | // We are permissive — just document the behavior |
| 910 | t.Skipfscip-go gomod github.com/golang/go/src go1.25 testing/common#Skipf().("permissive parser: r\"foo\" accepted (v1 compat)") |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | func TestSpecV2_Fail_NoSolidusEscapescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Fail_NoSolidusEscape().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 915 | // \/ is not a valid escape in v2 |
| 916 | _, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`node "\/"`) |
| 917 | if err == nil { |
| 918 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().("expected error for \\/ escape") |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | func TestSpecV2_Fail_MultiLineStringSingleLinescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Fail_MultiLineStringSingleLine().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 923 | _, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().(`node """one line"""`) |
| 924 | if err == nil { |
| 925 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().("expected error for single-line multi-line string") |
| 926 | } |
| 927 | } |
| 928 | |
| 929 | func TestSpecV2_Fail_FloatingPointKeywordIdentifiersscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/TestSpecV2_Fail_FloatingPointKeywordIdentifiers().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 930 | // In v2, bare inf/-inf/nan are not valid as keyword values |
| 931 | // (they'd be identifiers used as argument values) |
| 932 | // The spec says `floats inf -inf nan` should fail |
| 933 | // because inf/nan as identifiers cannot be used as values |
| 934 | // Our parser treats them as identifiers/strings, which is permissive |
| 935 | doc, err := Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Parse().("floats inf -inf nan") |
| 936 | if err != nil { |
| 937 | // Strict: fail (good) |
| 938 | return |
| 939 | } |
| 940 | // Permissive: verify they parse as something |
| 941 | if doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.[0].Namescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Name. != "floats" { |
| 942 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected node name 'floats'") |
| 943 | } |
| 944 | } |
| 945 | |
| 946 | // --- Helper assertions --- |
| 947 | |
| 948 | func assertNodeCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeCount().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, doc *Documentscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#, expected int) { |
| 949 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 950 | if len(doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.) != expected { |
| 951 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("expected %d nodes, got %d", expected, len(doc.Nodesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Document#Nodes.)) |
| 952 | } |
| 953 | } |
| 954 | |
| 955 | func assertNodeNamescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertNodeName().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, expected string) { |
| 956 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 957 | if n.Namescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Name. != expected { |
| 958 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("expected node name %q, got %q", expected, n.Namescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Name.) |
| 959 | } |
| 960 | } |
| 961 | |
| 962 | func assertArgCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgCount().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, expected int) { |
| 963 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 964 | if len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.) != expected { |
| 965 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("expected %d args, got %d", expected, len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.)) |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | func assertPropCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropCount().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, expected int) { |
| 970 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 971 | if len(n.Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties.) != expected { |
| 972 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("expected %d props, got %d", expected, len(n.Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties.)) |
| 973 | } |
| 974 | } |
| 975 | |
| 976 | func assertChildCountscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertChildCount().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, expected int) { |
| 977 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 978 | if len(n.Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.) != expected { |
| 979 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("expected %d children, got %d", expected, len(n.Childrenscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Children.)) |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | func assertArgStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgString().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, idx int, expected string) { |
| 984 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 985 | if idx >= len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.) { |
| 986 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg index %d out of range (have %d args)", idx, len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.)) |
| 987 | } |
| 988 | v, ok := n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(string) |
| 989 | if !ok { |
| 990 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg %d: expected string, got %T (%v)", idx, n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value., n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 991 | } |
| 992 | if v != expected { |
| 993 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("arg %d: expected %q, got %q", idx, expected, v) |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | func assertArgIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgInt().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, idx int, expected int64) { |
| 998 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 999 | if idx >= len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.) { |
| 1000 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg index %d out of range", idx) |
| 1001 | } |
| 1002 | v, ok := n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(int64) |
| 1003 | if !ok { |
| 1004 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg %d: expected int64, got %T (%v)", idx, n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value., n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1005 | } |
| 1006 | if v != expected { |
| 1007 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("arg %d: expected %d, got %d", idx, expected, v) |
| 1008 | } |
| 1009 | } |
| 1010 | |
| 1011 | func assertArgFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgFloat().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, idx int, expected float64) { |
| 1012 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1013 | if idx >= len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.) { |
| 1014 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg index %d out of range", idx) |
| 1015 | } |
| 1016 | v, ok := n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(float64) |
| 1017 | if !ok { |
| 1018 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg %d: expected float64, got %T (%v)", idx, n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value., n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1019 | } |
| 1020 | if v != expected { |
| 1021 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("arg %d: expected %f, got %f", idx, expected, v) |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | func assertArgBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgBool().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, idx int, expected bool) { |
| 1026 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1027 | if idx >= len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.) { |
| 1028 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg index %d out of range", idx) |
| 1029 | } |
| 1030 | v, ok := n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(bool) |
| 1031 | if !ok { |
| 1032 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg %d: expected bool, got %T (%v)", idx, n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value., n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1033 | } |
| 1034 | if v != expected { |
| 1035 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("arg %d: expected %v, got %v", idx, expected, v) |
| 1036 | } |
| 1037 | } |
| 1038 | |
| 1039 | func assertArgNullscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertArgNull().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, idx int) { |
| 1040 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1041 | if idx >= len(n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.) { |
| 1042 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("arg index %d out of range", idx) |
| 1043 | } |
| 1044 | if n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value. != nil { |
| 1045 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("arg %d: expected null, got %v", idx, n.Argumentsscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Arguments.[idx].Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1046 | } |
| 1047 | } |
| 1048 | |
| 1049 | func assertPropStringscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropString().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, key, expected string) { |
| 1050 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1051 | for _, p := range n.Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties. { |
| 1052 | if p.Keyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Key. == key { |
| 1053 | v, ok := p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(string) |
| 1054 | if !ok { |
| 1055 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q: expected string, got %T", key, p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1056 | } |
| 1057 | if v != expected { |
| 1058 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("prop %q: expected %q, got %q", key, expected, v) |
| 1059 | } |
| 1060 | return |
| 1061 | } |
| 1062 | } |
| 1063 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q not found", key) |
| 1064 | } |
| 1065 | |
| 1066 | func assertPropIntscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropInt().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, key string, expected int64) { |
| 1067 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1068 | // Find the LAST property with this key (last wins per spec) |
| 1069 | var found *Propertyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property# |
| 1070 | for _, p := range n.Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties. { |
| 1071 | if p.Keyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Key. == key { |
| 1072 | found = p |
| 1073 | } |
| 1074 | } |
| 1075 | if found == nil { |
| 1076 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q not found", key) |
| 1077 | } |
| 1078 | v, ok := found.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(int64) |
| 1079 | if !ok { |
| 1080 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q: expected int64, got %T", key, found.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1081 | } |
| 1082 | if v != expected { |
| 1083 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("prop %q: expected %d, got %d", key, expected, v) |
| 1084 | } |
| 1085 | } |
| 1086 | |
| 1087 | func assertPropFloatscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropFloat().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, key string, expected float64) { |
| 1088 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1089 | for _, p := range n.Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties. { |
| 1090 | if p.Keyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Key. == key { |
| 1091 | v, ok := p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(float64) |
| 1092 | if !ok { |
| 1093 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q: expected float64, got %T", key, p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1094 | } |
| 1095 | if v != expected { |
| 1096 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("prop %q: expected %f, got %f", key, expected, v) |
| 1097 | } |
| 1098 | return |
| 1099 | } |
| 1100 | } |
| 1101 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q not found", key) |
| 1102 | } |
| 1103 | |
| 1104 | func assertPropBoolscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropBool().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, key string, expected bool) { |
| 1105 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1106 | for _, p := range n.Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties. { |
| 1107 | if p.Keyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Key. == key { |
| 1108 | v, ok := p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value..(bool) |
| 1109 | if !ok { |
| 1110 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q: expected bool, got %T", key, p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1111 | } |
| 1112 | if v != expected { |
| 1113 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("prop %q: expected %v, got %v", key, expected, v) |
| 1114 | } |
| 1115 | return |
| 1116 | } |
| 1117 | } |
| 1118 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q not found", key) |
| 1119 | } |
| 1120 | |
| 1121 | func assertPropNullscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/assertPropNull().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#, n *Nodescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#, key string) { |
| 1122 | t.Helperscip-go gomod github.com/golang/go/src go1.25 testing/common#Helper().() |
| 1123 | for _, p := range n.Propertiesscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Node#Properties. { |
| 1124 | if p.Keyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Key. == key { |
| 1125 | if p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value. != nil { |
| 1126 | t.Errorfscip-go gomod github.com/golang/go/src go1.25 testing/common#Errorf().("prop %q: expected null, got %v", key, p.Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Property#Value..Valuescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/parsing/kdl/internal`/Value#Value.) |
| 1127 | } |
| 1128 | return |
| 1129 | } |
| 1130 | } |
| 1131 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("prop %q not found", key) |
| 1132 | } |