Fix regex for maven test to be case-sensitive

This commit is contained in:
Jeremy Dormitzer 2022-04-06 11:28:16 -04:00
parent 530952f046
commit 2aaac9da66

View File

@ -246,14 +246,16 @@
:command-line "mvn exec:java"
:working-dir project-dir)
(when-let ((test-class (and (buffer-file-name)
(string-match-p ".*\\(Test\\|IT\\).*\\.java$" (buffer-file-name))
(let ((case-fold-search nil))
(string-match-p ".*\\(Test\\|IT\\).*\\.java$" (buffer-file-name)))
(fboundp 'dap-java-test-class)
(dap-java-test-class))))
(list :command-name "test this class"
:command-line (format "mvn test -Dtest=%s" test-class)
:working-dir project-dir))
(when-let ((test-method (and (buffer-file-name)
(string-match-p ".*\\(Test\\|IT\\).*\\.java$" (buffer-file-name))
(let ((case-fold-search nil))
(string-match-p ".*\\(Test\\|IT\\).*\\.java$" (buffer-file-name)))
(fboundp 'dap-java-test-method-at-point)
(dap-java-test-method-at-point t))))
(list :command-name "test this method"