-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Tests for Robot Name not strict enough #35
Comments
Nice catch. Would you be willing to submit a patch for the test suite? https://github.com/exercism/xruby |
I just submitted a pull request addressing this issue. Let me know if there's anything I should improve before it can be merged. |
Don't we also need begin and end delimiters so it doesn't accept something like |
Yeah, it would be good to have tests agains that case. |
Hey, thanks! |
If you submitted changes to your fork, the PR will automatically be updated. Thanks! |
Addressing issue #35 - make robot-name tests more strict
Addressing issue #35 - make robot-name tests more strict
I think this issue can be closed, since #36 is closed as well. |
Yepp, good catch, thanks. |
update README.md with .json doc.
The
robot-name/README.md
specification states that robot name should conform to a format likeThat is, two letters and then three digits. Yet, the code that tests for this pattern is
/\w{2}\d{3}/
, which allows a string such as0.2542346345724565
to pass the test.I've checked how the tests for this exercise are implemented in a few other languages (perl5, haskell, lua) and they do enforce the two-letters-three-digits format, mostly by using
[a-zA-Z]
instead of\w
.I believe this is important because the tests should formalize the general idea provided by the README, where the specification is really not very specific, prompting learners to submit code that is unchallenging like my first submission to this exercise.
The text was updated successfully, but these errors were encountered: