-
-
Notifications
You must be signed in to change notification settings - Fork 365
Improved long data type support #1311
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
Conversation
@@ -7,42 +7,42 @@ public class PrimeFactorsTest | |||
[Fact] | |||
public void No_factors() | |||
{ | |||
Assert.Empty(PrimeFactors.Factors(1)); | |||
Assert.Empty(PrimeFactors.Factors(1L)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now made it clear that each input value is actually a long value. Previously, an implicit conversion was taking place, but this is more clear I feel.
@@ -8,90 +8,90 @@ public class SayTest | |||
[Fact] | |||
public void Zero() | |||
{ | |||
Assert.Equal("zero", Say.InEnglish(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now made it clear that each input value is actually a long value. Previously, an implicit conversion was taking place, but this is more clear I feel.
|
||
if (!(testMethod.Expected is string)) | ||
if (testMethod.ExpectedIsError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't resist a tiny cleanup :)
@@ -45,16 +45,12 @@ public static dynamic ConvertJToken(JToken jToken) | |||
|
|||
private static dynamic ConvertJObject(JObject jObject) | |||
{ | |||
var properties = jObject.ToObject<IDictionary<string, dynamic>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was the main issue, as the conversion here would result in the dictionary not containing JToken
values, which meant that the ConvertJToken
functionality (which already had code to deal with long/int value conversions) was not called.
Interestingly, the new code is way easier!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks @ErikSchierboom!
This PR adds improved support for the
long
data type.