Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure in test/go-indentation-test.el #430

Open
manphiz opened this issue Oct 21, 2023 · 1 comment
Open

Test failure in test/go-indentation-test.el #430

manphiz opened this issue Oct 21, 2023 · 1 comment

Comments

@manphiz
Copy link

manphiz commented Oct 21, 2023

ERT tests fail in test/go-indentation-test.el due to incorrect file path. The following patch should fix this (originally authored by Hilko Bengen [email protected]):

Index: go-mode.el/test/go-indentation-test.el
===================================================================
--- go-mode.el.orig/test/go-indentation-test.el
+++ go-mode.el/test/go-indentation-test.el
@@ -8,7 +8,7 @@
 (require 'go-mode)
 
 (ert-deftest go--indent-line ()
-  (dolist (file (directory-files (expand-file-name "testdata/indentation_tests/") t ".*\\.go$"))
+  (dolist (file (directory-files (expand-file-name "test/testdata/indentation_tests/") t ".*\\.go$"))
     (with-temp-buffer
       (go-mode)
       (insert-file-contents file)
@@ -19,7 +19,7 @@
 (ert-deftest go-dot-mod--indent-line ()
   (with-temp-buffer
     (go-dot-mod-mode)
-    (insert-file-contents "testdata/indentation_tests/go.mod")
+    (insert-file-contents "test/testdata/indentation_tests/go.mod")
     (let ((contents-before-indent (buffer-string)) (inhibit-message t))
       (indent-region (point-min) (point-max) nil)
       (should (string= contents-before-indent (buffer-string))))))
@dominikh
Copy link
Owner

dominikh commented Oct 21, 2023

I believe the tests were written under the assumption that tests would be batch-run from the test directory. I don't know what the idiomatic approach for ERT is here; I will have to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants