emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] scratch/editorconfig-cc 4b3784445a 180/351: Add trim-trailing-w


From: Stefan Monnier
Subject: [nongnu] scratch/editorconfig-cc 4b3784445a 180/351: Add trim-trailing-ws tests
Date: Thu, 13 Jun 2024 18:38:51 -0400 (EDT)

branch: scratch/editorconfig-cc
commit 4b3784445a0ea21dc49221cdb2a44873824a4812
Author: 10sr <8.slashes@gmail.com>
Commit: Stefan Monnier <monnier@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

[Prev in Thread] Current Thread [Next in Thread]