(t *testing.T)
| 546 | } |
| 547 | |
| 548 | func TestSelectOperation(t *testing.T) { |
| 549 | tests := []struct { |
| 550 | in string |
| 551 | expected Pipeline |
| 552 | expectedStr string |
| 553 | }{ |
| 554 | {in: "select(.a)", expected: newPipeline(newSelectOperation([]Attribute{NewAttribute("a")})), expectedStr: "select(.a)"}, |
| 555 | {in: "select(.a,.b)", expected: newPipeline(newSelectOperation([]Attribute{NewAttribute("a"), NewAttribute("b")})), expectedStr: "select(.a, .b)"}, |
| 556 | } |
| 557 | |
| 558 | for _, tc := range tests { |
| 559 | t.Run(tc.in, func(t *testing.T) { |
| 560 | actual, err := Parse(tc.in) |
| 561 | |
| 562 | require.NoError(t, err) |
| 563 | require.Equal(t, newRootExpr(tc.expected), actual) |
| 564 | require.Equal(t, tc.expectedStr, actual.String()) |
| 565 | }) |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | func TestSpansetExpressionErrors(t *testing.T) { |
| 570 | tests := []struct { |
nothing calls this directly
no test coverage detected