aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Pluim2023-03-22 12:46:11 +0100
committerRobert Pluim2023-03-22 12:48:49 +0100
commit103ebbf92f375cc6f44a2b49c85fbe3a6b1704d4 (patch)
treeed80b44127bc3ac6160f5c0ce3a8e9ada32d9f09
parent2d0de863618fd0341a5a781c26bf774e304ffd45 (diff)
downloademacs-103ebbf92f375cc6f44a2b49c85fbe3a6b1704d4.tar.gz
emacs-103ebbf92f375cc6f44a2b49c85fbe3a6b1704d4.zip
Make eglot--clangd-version more robust
* test/lisp/progmodes/eglot-tests.el (eglot--clangd-version): Check for 'version ' followed by a combination of numbers and dots to extract the clangd version.
-rw-r--r--test/lisp/progmodes/eglot-tests.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
index c4b23bfd64e..71d9d7270dd 100644
--- a/test/lisp/progmodes/eglot-tests.el
+++ b/test/lisp/progmodes/eglot-tests.el
@@ -316,9 +316,10 @@ then restored."
316 316
317(defun eglot--clangd-version () 317(defun eglot--clangd-version ()
318 "Report on the clangd version used in various tests." 318 "Report on the clangd version used in various tests."
319 (replace-regexp-in-string 319 (let ((version (shell-command-to-string "clangd --version")))
320 ".*version[[:space:]]+\\(.*\\)" "\\1" 320 (when (string-match "version[[:space:]]+\\([0-9.]*\\)"
321 (car (split-string (shell-command-to-string "clangd --version") "\n")))) 321 version)
322 (match-string 1 version))))
322 323
323 324
324;;; Unit tests 325;;; Unit tests