]> Sergey Matveev's repositories - path-extractor.git/commitdiff
Correct version number
authorEdgar HIPP <hipp.edg@gmail.com>
Sat, 16 Jan 2016 07:36:29 +0000 (08:36 +0100)
committerEdgar HIPP <hipp.edg@gmail.com>
Sat, 16 Jan 2016 07:36:29 +0000 (08:36 +0100)
pe_test.go
validators.go

index 677161c4f6f6b322d0a574dde7eef37888631276..bc07d279b695c12fb8f8c33e1cd2cc7f6efde3be 100644 (file)
@@ -132,6 +132,11 @@ func TestEverything(t *testing.T) {
                t.Errorf("Matches version number", output)
        }
 
+       output = GetAllMatches("14.22.2", "")
+       if len(output) != 0 {
+               t.Errorf("Matches version number", output)
+       }
+
        output = GetAllMatches("~/v1.2/js", "")
        if len(output) != 1 {
                t.Errorf("Should match path with version inside", output)
index 38704c79ee284d5e5239afde882fab9d0823778b..60a817c9beb239988faf277b377626d0ba467900 100644 (file)
@@ -52,7 +52,7 @@ func replaceGitPath(input string) string {
 }
 
 func isVersion(input string) bool {
-       r := regexp.MustCompile("^v?[0-9x]\\.[0-9x]{1,2}(\\.[0-9x]{1,3})?$")
+       r := regexp.MustCompile("^v?[0-9x]{1,3}\\.[0-9x]{1,3}(\\.[0-9x]{1,3})?$")
        return r.Match([]byte(input))
 }