You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should either just delete those test cases or change the function prototype to allow negative bases.
I think deleting the test case is more C like, allowing negative numbers there seems like a Java thing.
One other test case was not implemented per the cannonical-data
{
"description": "negative digit",
"property": "rebase",
"input_base": 2,
"input_digits": [1, -1, 1, 0, 1, 0],
"output_base": 10,
"expected": null
},```
The `C` track is implemented with a negative base instead of a negative. I can fix that case, or just delete it and make the arrays uint8_t[] vs int8_t[].
Let me know how you want me to proceed.
The text was updated successfully, but these errors were encountered:
Looking at the example for this I can see that it's only the test helper test_rebase() that uses unsigned parameter types. The implementation itself uses signed types.
My thought would be to keep the implementation using signed types and just correct the test helper to signed types also. This has two benefits. Firstly it allows tests for negative numbers (even if the correct behaviour for negative numbers is to not do a rebase). Secondly, signed types are generally considered safer than unsigned types when checking parameters potentially provided by client code (eg the tests).
All-your-base exercise has a couple of unit tests that assign negative numbers to uint data types.
example:
test_rebase is defined in the test case as:
We should either just delete those test cases or change the function prototype to allow negative bases.
I think deleting the test case is more
C
like, allowing negative numbers there seems like aJava
thing.One other test case was not implemented per the cannonical-data
The text was updated successfully, but these errors were encountered: