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

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

[nongnu] elpa/nix-mode da16900326 293/500: tests: Add a testcase with br


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode da16900326 293/500: tests: Add a testcase with broken identation to have as a check if it indents at all
Date: Sat, 29 Jan 2022 08:27:15 -0500 (EST)

branch: elpa/nix-mode
commit da169003263886c7ff325f9ff0a7adcbedd3a6e7
Author: Elis Hirwing <elis@hirwing.se>
Commit: Elis Hirwing <elis@hirwing.se>

    tests: Add a testcase with broken identation to have as a check if it 
indents at all
    
    This is to prevent bugs with running the indentation code at all in
    the future to not have regressions related to that.
---
 tests/nix-mode-tests.el               | 14 ++++++++++++++
 tests/testcases/failed-ident-test.nix |  7 +++++++
 2 files changed, 21 insertions(+)

diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
index 2487ea6674..84c223ce76 100644
--- a/tests/nix-mode-tests.el
+++ b/tests/nix-mode-tests.el
@@ -70,6 +70,20 @@ function to do the indentation tests."
        ;; Run additional tests
        ,@body)))
 
+(ert-deftest nix-mode-test-indent-failed-ident ()
+  "Proper indentation for items inside of a list."
+  (with-nix-mode-test
+   ;; File to read
+   ("failed-ident-test.nix")
+
+   ;; Indent the buffer
+   (indent-region (point-min) (point-max))
+
+   ;; Compare buffer to the stored buffer contents
+   (should-not (equal
+                (buffer-substring-no-properties (point-min) (point-max))
+                raw-file))))
+
 (ert-deftest nix-mode-test-indent-list-contents ()
   "Proper indentation for items inside of a list."
   (with-nix-mode-test ("list-contents.nix" :indent t)))
diff --git a/tests/testcases/failed-ident-test.nix 
b/tests/testcases/failed-ident-test.nix
new file mode 100644
index 0000000000..6d01f9d2c2
--- /dev/null
+++ b/tests/testcases/failed-ident-test.nix
@@ -0,0 +1,7 @@
+# This file is wrongly idented on purpose to have a failing test if the indent
+# doesn't run at all.
+[
+47
+"string"
+true
+]



reply via email to

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