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

Error in test suite #463

Open
mconca-kube opened this issue Apr 9, 2021 · 3 comments
Open

Error in test suite #463

mconca-kube opened this issue Apr 9, 2021 · 3 comments

Comments

@mconca-kube
Copy link

I found an error in the test suite for single/double values, here:

new object[] {Convert.ToSingle("10.5", CultureInfo.InvariantCulture).ToString(), 10.5},

and here:
new object[] {Convert.ToSingle("-2.8", CultureInfo.InvariantCulture).ToString(), -2.8},

You convert the string to a Single, using InvariantCulture: OK
After that you convert the Single value to string, using ToString(), but without specifying the culture.
It should be like this:
new object[] {Convert.ToSingle("10.5", CultureInfo.InvariantCulture).ToString(CultureInfo.InvariantCulture), 10.5}

If you run this test on a machine that has a culture with a differente decimal separator like comma, the test would expect the query to be compiled with value "10,5". The query instead compiles correctly with "10.5" and the test fails.

@ahmad-moussawi
Copy link
Contributor

Thanks for reporting, would you mind adding a PR for this?

@alexsee
Copy link

alexsee commented Jun 29, 2021

@mconca-kube I think you opened the merge request on the wrong repository ;)

Just a quick follow up on that: Wouldn't it be sufficient to just check for "10.5" and "-2.8" as a string, since the over complicated construct will always evaluate to these values, right?

@nester-a
Copy link

Hi there
Also found this error, but I think it can be solve like this:
new object[] {"10.5", 10.5},
new object[] {"-2.8", -2.8},

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

No branches or pull requests

4 participants