Skip to content
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

Pattern matching fix #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

frasermince
Copy link
Contributor

I have discovered that in some odd cases the rewrite will fail to occur despite the fact that it matched the pattern. I then discovered that sometimes Rule#string_matches? returns an Fixnum. This works just fine if the integer is not zero. If the integer is zero it causes Rule#matches to fail and the rewrite will not occur.

I wondered how this was missed in the test suite, and I further discovered that assert(0) comes back as true. I can think of no case where assert(0) succeeding would be a good idea. So I overrided assert in test_helper to have assert(0) fail. This revealed 14 failures which I then fixed. The only thing that might still need changing is the name of the class that inherits from Test::Unit::TestCase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant