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

Added option to remove spaces between parentheses #22

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

lu-zhengda
Copy link
Collaborator

This PR adds a new normalizer option RemoveSpaceBetweenParentheses that let user get rid of the additional spaces inserted between parentheses. The space was added initially for backward compatibility purpose.
The the option set to true, a normalized query will no longer have extra space between parentheses such as xx in ( ? ). Instead, the normalized output will be xx in (?).

@lu-zhengda lu-zhengda marked this pull request as ready for review October 26, 2023 17:43
@lu-zhengda lu-zhengda requested a review from a team as a code owner October 26, 2023 17:43
@@ -899,6 +939,38 @@ func TestNormalizerStoredProcedure(t *testing.T) {
}
}

func TestNormalizerWithoutSpaceBetweenParentheses(t *testing.T) {

Choose a reason for hiding this comment

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

I think this looks good but we might want to refactor the tests eventually to have test cases with input, expected and a set of options. That way, tests can be collocated for the same input but with different options and really clearly show the difference in expected result depending on those options.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah that is on my list.

@lu-zhengda lu-zhengda merged commit ea63d30 into main Oct 26, 2023
3 checks passed
@lu-zhengda lu-zhengda deleted the zhengda.lu/spaces branch October 26, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants