Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eskip: refactor parsing tests to check error message #2874

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

AlexanderYastrebov
Copy link
Member

Check value of error message to simplify followup fixes.

E.g. #1885 introduced last route id to the error message without tests but last route could be empty or should not be present at all for ParsePredicates and ParseFilters.

@AlexanderYastrebov AlexanderYastrebov added the minor no risk changes, for example new filters label Jan 18, 2024
Check value of error message to simplify followup fixes.

E.g. #1885 introduced last route id to the error message without tests
but last route could be empty or should not be present at all
for `ParsePredicates` and `ParseFilters`.

Signed-off-by: Alexander Yastrebov <[email protected]>
}, {
"error",
"trallala",
nil,
true,
// TODO: remove empty last route id and fix position
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Position fix could be done by #2873

for _, ti := range []struct {
msg string
expression string
check *Route
err bool
check []*Route
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: maybe expectedRoutes would be better naming?

Copy link
Member Author

@AlexanderYastrebov AlexanderYastrebov Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not rename struct fields to keep diff small. All three tests use different naming

@MustafaSaber
Copy link
Member

👍

1 similar comment
@AlexanderYastrebov
Copy link
Member Author

👍

@AlexanderYastrebov AlexanderYastrebov merged commit 4a0606a into master Jan 18, 2024
14 checks passed
@AlexanderYastrebov AlexanderYastrebov deleted the eskip/refactor-parse-tests branch January 18, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor no risk changes, for example new filters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants