[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode be06d675b8 315/500: Run tests for nix-indent-line
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode be06d675b8 315/500: Run tests for nix-indent-line and smie-indent-line |
Date: |
Sat, 29 Jan 2022 08:27:17 -0500 (EST) |
branch: elpa/nix-mode
commit be06d675b836031b7906f8fd678299b2d3853f2b
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Run tests for nix-indent-line and smie-indent-line
This gives us more coverage of both modes
---
tests/nix-mode-tests.el | 72 ++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 56 insertions(+), 16 deletions(-)
diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
index 700b8e9d44..db6d5a521e 100644
--- a/tests/nix-mode-tests.el
+++ b/tests/nix-mode-tests.el
@@ -54,15 +54,15 @@ function to do the indentation tests."
(nix-mode)
;; If we're doing an indentation test
- (if ,indent
- (progn
- ;; Indent the buffer
- (indent-region (point-min) (point-max))
+ (when ,indent
+ (let ((indent-line-function 'smie-indent-line))
+ ;; Indent the buffer
+ (indent-region (point-min) (point-max))
- ;; Compare buffer to the stored buffer contents
- (should (equal
- (buffer-substring-no-properties (point-min) (point-max))
- raw-file))))
+ ;; Compare buffer to the stored buffer contents
+ (should (equal
+ (buffer-substring-no-properties (point-min) (point-max))
+ raw-file))))
;; Go to beginning
(goto-char (point-min))
@@ -84,45 +84,85 @@ function to do the indentation tests."
(buffer-substring-no-properties (point-min) (point-max))
raw-file))))
+(ert-deftest nix-mode-test-indent-list-contents-smie ()
+ "Proper indentation for items inside of a list."
+ (with-nix-mode-test ("list-contents.nix" :indent 'smie-indent-line)))
+
(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)))
+ (with-nix-mode-test ("list-contents.nix" :indent 'nix-indent-line)))
+
+(ert-deftest nix-mode-test-indent-issue-60-1-smie ()
+ "Proper indentation of attrsets inside of lists inside of attrsets.
+
+Related issue: https://github.com/NixOS/nix-mode/issues/60"
+ (with-nix-mode-test ("issue-60.1.nix" :indent 'smie-indent-line)))
(ert-deftest nix-mode-test-indent-issue-60-1 ()
"Proper indentation of attrsets inside of lists inside of attrsets.
Related issue: https://github.com/NixOS/nix-mode/issues/60"
- (with-nix-mode-test ("issue-60.1.nix" :indent t)))
+ (with-nix-mode-test ("issue-60.1.nix" :indent 'nix-indent-line)))
+
+(ert-deftest nix-mode-test-indent-issue-60-2-smie ()
+ "Proper indentation of code inside of let blocks.
+
+Related issue: https://github.com/NixOS/nix-mode/issues/60"
+ (with-nix-mode-test ("issue-60.2.nix" :indent 'smie-indent-line)))
(ert-deftest nix-mode-test-indent-issue-60-2 ()
"Proper indentation of code inside of let blocks.
Related issue: https://github.com/NixOS/nix-mode/issues/60"
- (with-nix-mode-test ("issue-60.2.nix" :indent t)))
+ (with-nix-mode-test ("issue-60.2.nix" :indent 'nix-indent-line)))
-(ert-deftest nix-mode-test-indent-issue-60-3 ()
+(ert-deftest nix-mode-test-indent-issue-60-3-smie ()
"Proper indentation of import and newline after equal.
Related issue: https://github.com/NixOS/nix-mode/issues/60"
- (with-nix-mode-test ("issue-60.3.nix" :indent t)))
+ (with-nix-mode-test ("issue-60.3.nix" :indent 'smie-indent-line)))
+
+;; nix-indent-line and smie-indent-line conflict, so we just use smie
+;; (ert-deftest nix-mode-test-indent-issue-60-3 ()
+;; "Proper indentation of import and newline after equal.
+;; Related issue: https://github.com/NixOS/nix-mode/issues/60"
+;; (with-nix-mode-test ("issue-60.3.nix" :indent 'nix-indent-line)))
+
+(ert-deftest nix-mode-test-indent-issue-69-1-smie ()
+ "Proper indentation of an empty attrset.
+
+Related issue: https://github.com/NixOS/nix-mode/issues/69"
+ (with-nix-mode-test ("issue-69.1.nix" :indent 'smie-indent-line)))
(ert-deftest nix-mode-test-indent-issue-69-1 ()
"Proper indentation of an empty attrset.
Related issue: https://github.com/NixOS/nix-mode/issues/69"
- (with-nix-mode-test ("issue-69.1.nix" :indent t)))
+ (with-nix-mode-test ("issue-69.1.nix" :indent 'nix-indent-line)))
+
+(ert-deftest nix-mode-test-indent-issue-69-2-smie ()
+ "Proper indentation of an empty list.
+
+Related issue: https://github.com/NixOS/nix-mode/issues/69"
+ (with-nix-mode-test ("issue-60.2.nix" :indent 'smie-indent-line)))
(ert-deftest nix-mode-test-indent-issue-69-2 ()
"Proper indentation of an empty list.
Related issue: https://github.com/NixOS/nix-mode/issues/69"
- (with-nix-mode-test ("issue-60.2.nix" :indent t)))
+ (with-nix-mode-test ("issue-60.2.nix" :indent 'nix-indent-line)))
+
+(ert-deftest nix-mode-test-indent-issue-72-smie ()
+ "Proper indentation of strings in a multi-line string.
+
+Related issue: https://github.com/NixOS/nix-mode/issues/72"
+ (with-nix-mode-test ("issue-72.nix" :indent 'smie-indent-line)))
(ert-deftest nix-mode-test-indent-issue-72 ()
"Proper indentation of strings in a multi-line string.
Related issue: https://github.com/NixOS/nix-mode/issues/72"
- (with-nix-mode-test ("issue-72.nix" :indent t)))
+ (with-nix-mode-test ("issue-72.nix" :indent 'nix-indent-line)))
(provide 'nix-mode-tests)
;;; nix-mode-tests.el ends here
- [nongnu] elpa/nix-mode 42632ee471 168/500: Remove misc/ folder, (continued)
- [nongnu] elpa/nix-mode 42632ee471 168/500: Remove misc/ folder, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 93bfb4428d 182/500: Add nix-build function., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9d4eb7d199 274/500: Make find-file-at-point support <nixpkgs>, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 54f28871a3 376/500: Fix issue #70, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ef64fa293b 388/500: Set nix-version to nil, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 218c885d78 414/500: Merge pull request #116 from taku0/update-install-nix-action, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d6e895969b 400/500: Set the 'LD_LIBRARY_PATH' environment variable for mkShell, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c041115673 301/500: Fix failing test., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 01c53b7ff1 289/500: Merge pull request #66 from etu/add-travis-badge, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1d31733ef8 311/500: Add more function documentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode be06d675b8 315/500: Run tests for nix-indent-line and smie-indent-line,
ELPA Syncer <=
- [nongnu] elpa/nix-mode a33ccd4fd7 322/500: Add more issue test cases, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ce8f523eb6 330/500: Set the indent function to the value passed in in with-nix-mode-test, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 023a471576 329/500: Remove unnecessary while loop., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 82d26d496a 335/500: Fix easy-menu name, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode bf027132d0 341/500: Merge pull request #83 from j-piecuch/smie-tweaks, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5b5961780f 358/500: Merge pull request #90 from purcell/dash-syntax, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aa1fa07344 342/500: Fix handling of keywords in identifiers, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7d681ff81b 357/500: Merge pull request #91 from purcell/relative-executable-paths, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 47ec698474 422/500: Add version to invocation of define-obsolete-function-alias, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e32c6bf7ad 415/500: Merge pull request #115 from taku0/ffap-in-string, ELPA Syncer, 2022/01/29