(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestPipelineErrors(t *testing.T) { |
| 14 | tests := []struct { |
| 15 | in string |
| 16 | err error |
| 17 | }{ |
| 18 | {in: "", err: newParseError("syntax error: unexpected $end", 0, 0)}, |
| 19 | {in: "{ .a } | { .b", err: newParseError("syntax error: unexpected $end", 1, 14)}, |
| 20 | {in: "{ .a | .b }", err: newParseError("syntax error: unexpected |", 1, 6)}, |
| 21 | {in: "({ .a } | { .b }", err: newParseError("syntax error: unexpected $end, expecting ) or |", 1, 17)}, |
| 22 | {in: "({ .a } | { .b }) + ({ .a } | { .b })", err: newParseError("syntax error: unexpected +, expecting with", 1, 19)}, |
| 23 | } |
| 24 | |
| 25 | for _, tc := range tests { |
| 26 | t.Run(tc.in, func(t *testing.T) { |
| 27 | _, err := Parse(tc.in) |
| 28 | |
| 29 | require.Equal(t, tc.err, err) |
| 30 | }) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestPipelineOperatorPrecedence(t *testing.T) { |
| 35 | tests := []struct { |
nothing calls this directly
no test coverage detected