| 1 | package selector_testscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.25 testing/" |
| 5 | |
| 6 | "github.com/tomwright/dasel/v3/selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/" |
| 7 | "github.com/tomwright/dasel/v3/selector/astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/" |
| 8 | ) |
| 9 | |
| 10 | func TestParse_SimplePropertyscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector_test`/TestParse_SimpleProperty().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 11 | expr, err := selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/.Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/Parse().("foo") |
| 12 | if err != nil { |
| 13 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %v", err) |
| 14 | } |
| 15 | if !astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.IsTypescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/IsType().[astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.PropertyExprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/PropertyExpr#](expr) { |
| 16 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("expected PropertyExpr, got %T", expr) |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | func TestParse_ChainedSelectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector_test`/TestParse_ChainedSelector().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 21 | expr, err := selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/.Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/Parse().("foo.bar") |
| 22 | if err != nil { |
| 23 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("unexpected error: %v", err) |
| 24 | } |
| 25 | if !astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.IsTypescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/IsType().[astscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/.ChainedExprscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector/ast`/ChainedExpr#](expr) { |
| 26 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatalf().("expected ChainedExpr, got %T", expr) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func TestParse_ParserErrorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector_test`/TestParse_ParserError().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 31 | _, err := selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/.Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/Parse().("if") |
| 32 | if err == nil { |
| 33 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().("expected error for invalid selector") |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestParse_LexerErrorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector_test`/TestParse_LexerError().(t *testingscip-go gomod github.com/golang/go/src go1.25 testing/.Tscip-go gomod github.com/golang/go/src go1.25 testing/T#) { |
| 38 | _, err := selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/.Parsescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/selector`/Parse().(`"hello`) |
| 39 | if err == nil { |
| 40 | t.Fatalscip-go gomod github.com/golang/go/src go1.25 testing/common#Fatal().("expected error for unterminated string") |
| 41 | } |
| 42 | } |