branch: externals/matlab-mode
commit c48e8b8610a6846d11ff5a47e5998132def31252
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
t-utils: update to insert a final new line for sweep test grammar
---
matlab-ts-mode.el | 5 -----
tests/t-utils.el | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/matlab-ts-mode.el b/matlab-ts-mode.el
index 948bee9c90..eccc824e0e 100644
--- a/matlab-ts-mode.el
+++ b/matlab-ts-mode.el
@@ -3544,11 +3544,6 @@ so configuration variables of that mode, do not affect
this mode.
;; Activate MATLAB script ";; heading" matlab-sections-minor-mode if needed
(matlab-sections-auto-enable-on-mfile-type-fcn
(matlab-ts-mode--mfile-type))
- ;; TODO test/sweep-test-matlab-ts-grammar.sh
- ;; Detect when there's no ending newline and report that.
- ;; Perhaps do this in matlab-ts-mode?
- ;; Add newline for sweep test if need?
- ;;
;; TODO [future] Improve semantic movement
;; thing-settings doesn't work well. Directly implement C-M-f, M-e,
etc.
;;
diff --git a/tests/t-utils.el b/tests/t-utils.el
index 50e39abdd2..274d529f72 100644
--- a/tests/t-utils.el
+++ b/tests/t-utils.el
@@ -1997,6 +1997,11 @@ otherwise the result is displayed on stdout."
(condition-case err
(progn
(t-utils--insert-file-for-test lang-file major-mode-fun)
+ (save-excursion
+ (goto-char (point-max))
+ ;; tree-sitter requires a final newline. Without a final
newline, a parse error will occur.
+ (when (not (looking-at "\n"))
+ (insert "\n")))
(setq ok t))
(error
(t-utils--log log-file (format "Skipping %s, %s\n"