Improved long data type support#1311
Improved long data type support#1311robkeim merged 2 commits intoexercism:masterfrom ErikSchierboom:long-parsing
Conversation
| public void No_factors() | ||
| { | ||
| Assert.Empty(PrimeFactors.Factors(1)); | ||
| Assert.Empty(PrimeFactors.Factors(1L)); |
There was a problem hiding this comment.
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.
| [Fact] | ||
| public void Zero() | ||
| { | ||
| Assert.Equal("zero", Say.InEnglish(0)); |
There was a problem hiding this comment.
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.
| testMethod.Input["number"] = (long)testMethod.Input["number"]; | ||
|
|
||
| if (!(testMethod.Expected is string)) | ||
| if (testMethod.ExpectedIsError) |
There was a problem hiding this comment.
I couldn't resist a tiny cleanup :)
|
|
||
| private static dynamic ConvertJObject(JObject jObject) | ||
| { | ||
| var properties = jObject.ToObject<IDictionary<string, dynamic>>(); |
There was a problem hiding this comment.
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!
robkeim
left a comment
There was a problem hiding this comment.
Looks good to me, thanks @ErikSchierboom!
This PR adds improved support for the
longdata type.