From 522998980ee0d2433e68c303e9bc08641ee85cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20K=2E=20Papp?= Date: Tue, 9 Apr 2024 07:07:18 +0200 Subject: [PATCH 1/2] add 29.x Emacs versions to CI matrix --- .github/workflows/CI.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7e419b8..72fcde1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,6 +24,9 @@ jobs: - 27.2 - 28.1 - 28.2 + - 29.1 + - 29.2 + - 29.3 ignore_warnings: - true # NOTE commented out because failure notifications are a distraction From 0f1f8f57e468094fcf175643dd9e223c21a7e36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20K=2E=20Papp?= Date: Tue, 9 Apr 2024 08:06:30 +0200 Subject: [PATCH 2/2] factor out the logic of julia--should-move-point to a function --- julia-mode-tests.el | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 24eca8b..45db3c7 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -64,28 +64,36 @@ "Assert that TEXT at position POS gets font-locked with FACE in `julia-mode'." `(should (eq ,face (julia--get-font-lock ,text ,pos)))) +(defun julia--should-move-point-helper (text fun from to &optional end arg) + "Takes the same arguments as `julia--should-move-point', returns a cons of the expected and the actual point." + (with-temp-buffer + (julia-mode) + (insert text) + (indent-region (point-min) (point-max)) + (goto-char (point-min)) + (if (stringp from) + (re-search-forward from) + (goto-char from)) + (funcall fun arg) + (let ((actual-to (point)) + (expected-to + (if (stringp to) + (progn (goto-char (point-min)) + (re-search-forward to) + (if end (goto-char (match-end 0)) + (goto-char (match-beginning 0)) + (point-at-bol))) + to))) + (cons expected-to actual-to)))) + (defmacro julia--should-move-point (text fun from to &optional end arg) "With TEXT in `julia-mode', after calling FUN, the point should move FROM\ to TO. If FROM is a string, move the point to matching string before calling function FUN. If TO is a string, match resulting point to point a beginning of matching line or end of match if END is non-nil. Optional ARG is passed to FUN." (declare (indent defun)) - `(with-temp-buffer - (julia-mode) - (insert ,text) - (indent-region (point-min) (point-max)) - (goto-char (point-min)) - (if (stringp ,from) - (re-search-forward ,from) - (goto-char ,from)) - (funcall ,fun ,arg) - (should (eq (point) (if (stringp ,to) - (progn (goto-char (point-min)) - (re-search-forward ,to) - (if ,end (goto-char (match-end 0)) - (goto-char (match-beginning 0)) - (point-at-bol))) - ,to))))) + `(let ((positions (julia--should-move-point-helper ,text ,fun ,from ,to ,end ,arg))) + (should (eq (car positions) (cdr positions))))) ;;; indent tests