fix(go): exactly match test function name
This commit is contained in:
parent
781e80d849
commit
a8dabe1aec
1 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@
|
|||
(if (string-match "_test\\.go" buffer-file-name)
|
||||
(save-excursion
|
||||
(re-search-backward "^func[ ]+\\(([[:alnum:]]*?[ ]?[*]?[[:alnum:]]+)[ ]+\\)?\\(Test[[:alnum:]_]+\\)(.*)")
|
||||
(+go--run-tests (concat "-run" "='" (match-string-no-properties 2) "'")))
|
||||
(+go--run-tests (concat "-run" "='^\\Q" (match-string-no-properties 2) "\\E$'")))
|
||||
(error "Must be in a _test.go file")))
|
||||
|
||||
;;;###autoload
|
||||
|
@ -52,7 +52,7 @@
|
|||
(if (string-match "_test\\.go" buffer-file-name)
|
||||
(save-excursion
|
||||
(re-search-backward "^func[ ]+\\(([[:alnum:]]*?[ ]?[*]?[[:alnum:]]+)[ ]+\\)?\\(Benchmark[[:alnum:]_]+\\)(.*)")
|
||||
(+go--run-tests (concat "-test.run=NONE -test.bench" "='" (match-string-no-properties 2) "'")))
|
||||
(+go--run-tests (concat "-test.run=NONE -test.bench" "='^\\Q" (match-string-no-properties 2) "\\E$'")))
|
||||
(error "Must be in a _test.go file")))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue