From 2aaac9da66808a9a0159463f3ce9b2f2831c59ae Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Wed, 6 Apr 2022 11:28:16 -0400 Subject: [PATCH] Fix regex for maven test to be case-sensitive --- emacs/.emacs.d/config/init-run-command.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs/.emacs.d/config/init-run-command.el b/emacs/.emacs.d/config/init-run-command.el index 53db5d9..636126f 100644 --- a/emacs/.emacs.d/config/init-run-command.el +++ b/emacs/.emacs.d/config/init-run-command.el @@ -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"