branch: externals/matlab-mode
commit 1430f5e76142f77a7f8d8a1d2fdf6925f0dbde1e
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>

    test-matlab-ts-mode-parser.el: make robust to running from any directory
---
 tests/test-matlab-ts-mode-parser.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/test-matlab-ts-mode-parser.el 
b/tests/test-matlab-ts-mode-parser.el
index 763313b3de..74909bb16c 100644
--- a/tests/test-matlab-ts-mode-parser.el
+++ b/tests/test-matlab-ts-mode-parser.el
@@ -63,9 +63,11 @@ To understand the format of NAME_expected.txt files, see
   ;; Validate following file does not have a final newline. matlab tree-sitter 
requires a final
   ;; newline for a valid parse because it uses newlines to identify the end of 
statements.
   (with-temp-buffer
-    (insert-file-contents-literally 
"test-matlab-ts-mode-parser-files/parser_no_final_newline.m")
-    (goto-char (point-max))
-    (should (equal (= (char-before) ?\n) nil)))
+    (let* ((me (symbol-file 'test-matlab-ts-mode-parser))
+           (file (replace-regexp-in-string "\\.el$" 
"-files/parser_no_final_newline.m" me)))
+      (insert-file-contents-literally file)
+      (goto-char (point-max))
+      (should (equal (= (char-before) ?\n) nil))))
 
   (let* ((test-name "test-matlab-ts-mode-parser")
          (m-files (t-utils-get-files test-name

Reply via email to