[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode 8a84fcb858 13/14: Merge pull request #209 from
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode 8a84fcb858 13/14: Merge pull request #209 from tpapp/tp/tweak-end-of-defun-tests |
Date: |
Mon, 6 May 2024 10:01:21 -0400 (EDT) |
branch: elpa/julia-mode
commit 8a84fcb858571cd9212557bba48ad9b17cdef8e7
Merge: 60f23fea66 eadbdbe1de
Author: Tamas K. Papp <tkpapp@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #209 from tpapp/tp/tweak-end-of-defun-tests
Change tests so that we test our own implementations only.
---
julia-mode-tests.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index 45db3c7810..0fd4d21c20 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -64,7 +64,7 @@
"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)
+(defun julia--should-move-point-helper (text fun from to &optional end &rest
args)
"Takes the same arguments as `julia--should-move-point', returns a cons of
the expected and the actual point."
(with-temp-buffer
(julia-mode)
@@ -74,25 +74,26 @@
(if (stringp from)
(re-search-forward from)
(goto-char from))
- (funcall fun arg)
+ (apply fun args)
(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))
+ (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)
+(defmacro julia--should-move-point (text fun from to &optional end &rest args)
"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))
- `(let ((positions (julia--should-move-point-helper ,text ,fun ,from ,to ,end
,arg)))
+ `(let ((positions (julia--should-move-point-helper ,text ,fun ,from ,to ,end
,@args)))
(should (eq (car positions) (cdr positions)))))
;;; indent tests
@@ -892,10 +893,10 @@ return n * fact(n-1)
end
end
return fact(x)
-end" 'end-of-defun "n == 0" "end[ \n]+end\n" 'end))
+end" 'julia-end-of-defun "function fact(n)" "end[ \n]+end" 'end))
(ert-deftest julia--test-end-of-defun-nested-2 ()
- "Point should move to end of outer function when called from inner with
prefix."
+ "Point should move to end of outer function when called from outer."
(julia--should-move-point
"function f(x)
function fact(n)
@@ -906,7 +907,7 @@ return n * fact(n-1)
end
end
return fact(x)
-end" 'end-of-defun "n == 0" "return fact(x)[ \n]+end" 'end 2))
+end" 'julia-end-of-defun "function f(x)" "return fact(x)[ \n]+end" 'end))
;;;
;;; latex completion tests
- [nongnu] elpa/julia-mode 9d0740678e 01/14: WIP: option to restore previous TAB behavior, (continued)
- [nongnu] elpa/julia-mode 9d0740678e 01/14: WIP: option to restore previous TAB behavior, ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode eadbdbe1de 12/14: Revert "Update julia-mode-tests.el", ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode d360ad5285 14/14: Merge pull request #196 from tpapp/tp/repl-style-completion, ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode fecfe20927 11/14: Update julia-mode-tests.el, ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode 7b00566570 05/14: fix, ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode b390203f0c 04/14: oops, now we include \\, this should fix tests, ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode 5f2e774535 09/14: Make selection customizable., ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode 86da879ec2 08/14: fixes suggested by @dhanak (thanks!), ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode fef78c5ae3 03/14: Add greedy match option., ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode 4a1a68cefa 07/14: Merge branch 'master' into tp/repl-style-completion, ELPA Syncer, 2024/05/06
- [nongnu] elpa/julia-mode 8a84fcb858 13/14: Merge pull request #209 from tpapp/tp/tweak-end-of-defun-tests,
ELPA Syncer <=