64
64
" Assert that TEXT at position POS gets font-locked with FACE in `julia-mode' ."
65
65
`(should (eq , face (julia--get-font-lock , text , pos ))))
66
66
67
- (defun julia--should-move-point-helper (text fun from to &optional end arg )
67
+ (defun julia--should-move-point-helper (text fun from to &optional end &rest args )
68
68
" Takes the same arguments as `julia--should-move-point' , returns a cons of the expected and the actual point."
69
69
(with-temp-buffer
70
70
(julia-mode)
74
74
(if (stringp from)
75
75
(re-search-forward from)
76
76
(goto-char from))
77
- (funcall fun arg )
77
+ (apply fun args )
78
78
(let ((actual-to (point ))
79
79
(expected-to
80
80
(if (stringp to)
81
81
(progn (goto-char (point-min ))
82
82
(re-search-forward to)
83
- (if end (goto-char (match-end 0 ))
83
+ (if end
84
+ (goto-char (match-end 0 ))
84
85
(goto-char (match-beginning 0 ))
85
86
(point-at-bol )))
86
87
to)))
87
88
(cons expected-to actual-to))))
88
89
89
- (defmacro julia--should-move-point (text fun from to &optional end arg )
90
+ (defmacro julia--should-move-point (text fun from to &optional end &rest args )
90
91
" With TEXT in `julia-mode' , after calling FUN, the point should move FROM\
91
92
to TO. If FROM is a string, move the point to matching string before calling
92
93
function FUN. If TO is a string, match resulting point to point a beginning of
93
94
matching line or end of match if END is non-nil. Optional ARG is passed to FUN."
94
95
(declare (indent defun ))
95
- `(let ((positions (julia--should-move-point-helper , text , fun , from , to , end , arg )))
96
+ `(let ((positions (julia--should-move-point-helper , text , fun , from , to , end ,@args )))
96
97
(should (eq (car positions) (cdr positions)))))
97
98
98
99
; ;; indent tests
@@ -892,10 +893,10 @@ return n * fact(n-1)
892
893
end
893
894
end
894
895
return fact(x)
895
- end" 'end-of-defun " n == 0 " " end[ \n ]+end\n " 'end ))
896
+ end" 'julia- end-of-defun " function fact(n) " " end[ \n ]+end" 'end ))
896
897
897
898
(ert-deftest julia--test-end-of-defun-nested-2 ()
898
- " Point should move to end of outer function when called from inner with prefix ."
899
+ " Point should move to end of outer function when called from outer ."
899
900
(julia--should-move-point
900
901
" function f(x)
901
902
function fact(n)
@@ -906,7 +907,7 @@ return n * fact(n-1)
906
907
end
907
908
end
908
909
return fact(x)
909
- end" 'end-of-defun " n == 0 " " return fact(x)[ \n ]+end" 'end 2 ))
910
+ end" 'julia- end-of-defun " function f(x) " " return fact(x)[ \n ]+end" 'end ))
910
911
911
912
; ;;
912
913
; ;; latex completion tests
0 commit comments