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

fix parse for tags w/ double digit patch numbers #3

Merged
merged 1 commit into from Jun 3, 2016
Merged

fix parse for tags w/ double digit patch numbers #3

merged 1 commit into from Jun 3, 2016

Conversation

natefinch
Copy link
Contributor

@natefinch natefinch commented Jun 3, 2016

Turns out the tag group (\w+) would consume all but the last digit of the patch, because \w+ matches numbers as well as letters. In talking to Martin, we're pretty sure we don't need to match anything but a-z for the tag name, so I changed it to that, and fixed the tests to match this assumption.

@@ -45,14 +45,13 @@ func (*suite) TestCompare(c *gc.C) {
{"2.0.0.0", "2.0.0.0", 0},
{"2.0.0.1", "2.0.0.0", 1},
{"2.0.1.10", "2.0.0.0", 1},
{"2.0-_0", "2.0-00", 1},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was removed because 2.0-00 is not actually a valid version, so it errors out (it has a zero length tag specified). It used to work because the tag was getting parsed as "0"

@bz2
Copy link

bz2 commented Jun 3, 2016

LGTM. Lets make the tag match just [a-z]+ as that's all we've used so far.

We don't actually want anything but a-z in the tag name
@natefinch natefinch merged commit 4ae6172 into juju:master Jun 3, 2016
babbageclunk added a commit to babbageclunk/version that referenced this pull request Sep 15, 2016
Since commit 4ae6172 (juju#3),
version.Number.Tag will never include any digits, so this test was
incorrect.
jujubot added a commit to juju/charm that referenced this pull request Sep 15, 2016
Update test to match changed juju/version behaviour

Since commit [4ae6172](juju/version@4ae6172) (juju/version#3), `version.Number.Tag` will never include any digits, so this test became incorrect.
natefinch added a commit that referenced this pull request Sep 16, 2016
This makes the code a little easier to follow, and we remove the nested groups which are kind of confusing.
natefinch added a commit that referenced this pull request Sep 16, 2016
This makes the code a little easier to follow, and we remove the nested groups which are kind of confusing.
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.

None yet

2 participants