Giter Club home page Giter Club logo

Comments (5)

ryanplusplus avatar ryanplusplus commented on May 12, 2024 1

@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.

 avatar commented on May 12, 2024

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.

wolf99 avatar wolf99 commented on May 12, 2024

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.

ryanplusplus avatar ryanplusplus commented on May 12, 2024

Agreed. We should fix everything up when we address this issue.

from c.

wolf99 avatar wolf99 commented on May 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.