phone-number 1.5.0.6: add cases to test data that cover invalid use of "1" or "0"#722
phone-number 1.5.0.6: add cases to test data that cover invalid use of "1" or "0"#722petertseng merged 1 commit intoexercism:masterfrom sshine:phone-number-1.5.0.6
Conversation
petertseng
left a comment
There was a problem hiding this comment.
So! Since exercism/problem-specifications#1327 was taken instead, I suggest either using those cases. Or an option can be to leave it for another person to use those cases.
|
I'll adopt the new cases. |
|
To go to version 1.6.0 of problem-specifications for phone-number seems to require us to use |
|
@sshine Why? How a specific error object from the spec is represented in the actual implementations is totally up to the track. |
|
@NobbZ I said it seems like that, but I'm happy to know that individual tracks can disregard errors. If we're going to keep the |
petertseng
left a comment
There was a problem hiding this comment.
This is, as far as I can see, the correct thing to do for 1.5.0, so we should merge this.
1.6.0: Does the student learn anything more interesting if required to distinguish the different sorts of errors that could occur?
If yes, should use Either. Some possible types to use for the Left would probably be:
- discriminated union
- the leftmost invalid character and the position at which it occurs
I'd advise against using a String as Left type.
If no, should use Maybe.
|
I think we should keep to I agree with your points. |
This should catch solutions with a validation function that calls itself recursively when the first digit is '1'.
Addresses exercism/problem-specifications#1325