mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-21 05:41:01 +02:00
Refactor TestParseExpressions to be more explicit about errors
Right now TestParseExpressions tests if a query returns an error but it only does a fuzzy check on returned errors. The error returned by the parser is ParseErrors, which is a slice of ParseErr structs. The Error() method on ParseErrors will return an error string based on the first error in that slice. This hides other returned errors so we can end up with bogus errors being returned but won't ever find this via this test. This change makes the test compare returned error (which is always ParseErrors type) with expected ParseErrors slice. The extra benefit of this is that current tests mostly ignore error positional range and only test for correct error message. Now errors must return expected positional information. There are a few cases uncovered where the positional informatio of errors seems wrong, added FIXME for these lines. Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>
This commit is contained in:
parent
7b308dc7fe
commit
7e22d2e5c0
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user