Skip to content

Commit

Permalink
Ensure parsing a serialized LogQL AST results in the same AST.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeschkies committed Nov 14, 2023
1 parent 117f108 commit 91cdb6c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/logql/syntax/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3144,6 +3144,12 @@ func TestParse(t *testing.T) {
ast, err := ParseExpr(tc.in)
require.Equal(t, tc.err, err)
require.Equal(t, tc.exp, ast)

if err == nil {
roundtrip, err := ParseExpr(ast.String())
require.NoError(t, err)
require.Equal(t, ast, roundtrip)
}
})
}
}
Expand Down

0 comments on commit 91cdb6c

Please sign in to comment.