branch: scratch/editorconfig-cc
commit 4b3784445a0ea21dc49221cdb2a44873824a4812
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    Add trim-trailing-ws tests
    
    With case where read-only-mode is enabled
---
 ert-tests/editorconfig.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ert-tests/editorconfig.el b/ert-tests/editorconfig.el
index 4aebde67cf..cd57f2e26d 100644
--- a/ert-tests/editorconfig.el
+++ b/ert-tests/editorconfig.el
@@ -52,3 +52,16 @@
                        "2_space.el")
       (should (eq lisp-indent-offset 2))))
   (editorconfig-mode -1))
+
+(ert-deftest test-trim-trailing-ws nil
+  (editorconfig-mode 1)
+  (with-visit-file (concat editorconfig-ert-dir
+                           "trim.txt")
+    (should (memq 'delete-trailing-whitespace
+                  write-file-functions)))
+  (with-visit-file (concat editorconfig-ert-dir
+                           "trim.txt")
+    (read-only-mode 1)
+    (should (not (memq 'delete-trailing-whitespace
+                       write-file-functions))))
+  (editorconfig-mode -1))

Reply via email to