extractor.go | 2 +- pe_test.go | 12 ++++++++++++ diff --git a/extractor.go b/extractor.go index e05ad4b93b50730c149315f98b68ec5655ba9fa7..2f764aa56183f02ddf6868fce4f23b87468297c3 100644 --- a/extractor.go +++ b/extractor.go @@ -59,7 +59,7 @@ return result } func getCursorPosition(input string) string { - r := regexp.MustCompile("^(:[0-9]+(:[0-9]+)?)$") + r := regexp.MustCompile("^(:[0-9]+(:[0-9]+)?)") temp := [][]byte{} temp = r.FindSubmatch([]byte(input)) if len(temp) <= 1 { diff --git a/pe_test.go b/pe_test.go index 18297677e2aca6a578eacfcc967ae18fcc148add..c9726174fd46962e9859cbaf13deb1ce41ecf0f8 100644 --- a/pe_test.go +++ b/pe_test.go @@ -198,4 +198,16 @@ } if output[0] != "test.js:45:12" { t.Errorf("Ackmate should output right line number", output) } + + output = GetAllMatches("test.js:45:12 foo bar", "ackmate") + if len(output) != 1 { + t.Errorf("Ackmate doesnt match", output) + } + + if output[0] == "test.js" { + t.Errorf("Ackmate should not forget number", output) + } + if output[0] != "test.js:45:12" { + t.Errorf("Ackmate should output right line number", output) + } }