-
-
Notifications
You must be signed in to change notification settings - Fork 556
phone-number: Rewrite description and add tests #745
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
Removes the part about how to test, as we have other docs for that. Now it also describes the telephone number system in a bit more detail. Changes some test that used an invalid number but assumed it was valid. Adds two tests that check the range of 2-9 for the first digit of the area and the exchange code. Adds a test with a valid telephone number with country code and punctuation.
We could also add new properties, but I think that's maybe to much. {
"description": "extract area code",
"property": "area",
"phrase": "(223) 456-7890",
"expected": "223"
},
{
"description": "extract exchange code",
"property": "exchange",
"phrase": "223.456.7890",
"expected": "456"
}, Fits nice with those tracks that solve this with a |
I like the tests with the leading number avoiding the 1. As far as the parts of the number, the names of those parts sometimes comes up in reviews (at least on the Ruby track). |
``` | ||
where N is any digit from 2 through 9 and X is any digit from 0 through 9. | ||
|
||
You task is to clean up differently formated telephone numbers by removeing punctuatin and the country code (1) if present. |
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.
You
should be Your
on line 12.
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.
and "Punctuation" is misspelled.
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.
and "Removing"
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.
Thx!
Sorry, for the sloppy work. I'll try to remember to use a spell checker next time.
@behrtam LGTM! |
So, should I add the additional properties like |
@petertseng wrote:
Well those two additional properties are mentioned in the new description. |
Good point. It is later now. :)
Sent from my android device.
|
The conclusion in the previous PR was to not add them anyway. I vote no, to adding the new properties. |
I wouldn't really call a single post without interaction "conclusion" ... as I don't have any opinion about the additionl properties I'm fine with not adding them. I will fix the typos later when I'm back at a real device. |
NANP (1.1.0): exercism/problem-specifications#745 Remove letters+numbers mixed test (1.2.0): https://github.com/exercism/problem-specifications/pull/772/files Closes #310
Removes the part about how to test, as we have other docs for that. Now it also describes the telephone number system in a bit more detail.
Changes some test that used an invalid number but assumed it was valid.
Adds two tests that check the range of 2-9 for the first digit of the area and the exchange code.
Adds a test with a valid telephone number with country code and punctuation.