Comments (5)
@deathsec I agree, but the purpose of the exercise isn't to be a 100% accurate, production-ready phone number system. The tests should come from here: https://github.com/exercism/x-common/blob/master/exercises/phone-number/canonical-data.json. If you think there are gaps in the exercise that can be corrected, the place to do it is in the x-common
repository.
from c.
We cannot actually say how many digits are allowed in phone numbers , it differs from country to country , there are even 11 to 14 digit phone numbers.
from c.
then it's missing a few tests (and has some tests that aren't listed at all in xcommon)
{
"description": "invalid when 12 digits",
"phrase": "321234567890",
"expected": null
},
{
"description": "invalid with letters",
"phrase": "123-abc-7890",
"expected": null
},
{
"description": "invalid with punctuations",
"phrase": "123-@:!-7890",
"expected": null
},
{
"description": "invalid with right number of digits but letters mixed in",
"phrase": "1a2b3c4d5e6f7g8h9i0j",
"expected": null
}
The first in the above checks for one of the cases greater than 11 (i.e. 12) but not all. I'll raise an issue for that there, but there remains the fact that the tests for the xc execrcise differs quite a bit from the xcommon spec shown above.
from c.
Agreed. We should fix everything up when we address this issue.
from c.
The change to x-common repo is made in #719. the test case now reads:
{
"description": "invalid when more than 11 digits",
"property": "clean",
"phrase": "321234567890",
"expected": null
},
I'll start a PR for the tests I mentioned in the earlier comment
from c.
Related Issues (20)
- Binary Search Tree: Test root node with value == 0 is allowed HOT 2
- Newer C standard HOT 6
- [c language] - queen attack invalid test 'test_can_attack_on_first_diagonal' HOT 4
- Darts - is there an inconsistency between the tests and the overview page description? HOT 6
- Exercise ResistorColor is confusing or too difficult HOT 22
- Sum Of Multiples - incorrect tests HOT 3
- Implement the exercise "reverse-string" HOT 1
- Implement the exercise "high-scores" HOT 9
- Change to "community-contributions-accepted" HOT 2
- Expected and actual assertion arguments reversed in some tests HOT 2
- Docs: test framework overview links to empty article HOT 1
- More documentation to `Grade School` HOT 1
- Add `make memcheck` tip for the HELP.md file. HOT 1
- Building a training set of tags for c HOT 23
- Rework the gigasecond exercise? HOT 3
- Problems in pascals-triangle test HOT 12
- The order of the results actually matters for the Word Count exercise HOT 4
- Pascal's Triangle has a bad Test Case defining Zero Rows. HOT 2
- Exercises for #48in24 HOT 17
- pig latin in C track HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c.