mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Merge pull request #1622 from jsravn/fix-go-test-rerun
Fix +go/test-rerun
This commit is contained in:
@ -6,17 +6,21 @@
|
|||||||
(defvar +go-test-last nil
|
(defvar +go-test-last nil
|
||||||
"The last test run.")
|
"The last test run.")
|
||||||
|
|
||||||
(defun +go--run-tests (args)
|
(defun +go--spawn (cmd)
|
||||||
(require 'async)
|
|
||||||
(save-selected-window
|
(save-selected-window
|
||||||
(async-shell-command (concat "go test " args))))
|
(compile cmd)))
|
||||||
|
|
||||||
|
(defun +go--run-tests (args)
|
||||||
|
(let ((cmd (concat "go test " args)))
|
||||||
|
(setq +go-test-last (concat "cd " default-directory ";" cmd))
|
||||||
|
(+go--spawn cmd)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/test-rerun ()
|
(defun +go/test-rerun ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(if +go-test-last
|
(if +go-test-last
|
||||||
(funcall +go-test-last)
|
(+go--spawn +go-test-last)
|
||||||
(+go/run-all-tests)))
|
(+go/test-all)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +go/test-all ()
|
(defun +go/test-all ()
|
||||||
|
Reference in New Issue
Block a user