[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode ce8f523eb6 330/500: Set the indent function to th
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode ce8f523eb6 330/500: Set the indent function to the value passed in in with-nix-mode-test |
Date: |
Sat, 29 Jan 2022 08:27:18 -0500 (EST) |
branch: elpa/nix-mode
commit ce8f523eb6e119d20021baf12b6d51352c0db8b9
Author: Jakub Piecuch <j.piecuch96@gmail.com>
Commit: Jakub Piecuch <j.piecuch96@gmail.com>
Set the indent function to the value passed in in with-nix-mode-test
---
tests/nix-mode-tests.el | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
index 2855357cb0..398390b795 100644
--- a/tests/nix-mode-tests.el
+++ b/tests/nix-mode-tests.el
@@ -39,8 +39,9 @@
(cl-defmacro with-nix-mode-test ((file &key indent) &rest body)
"Set up environment for testing `nix-mode'.
Execute BODY in a temporary buffer containing the contents of
-FILE, in `nix-mode'. All tests will use the `nix-indent-line'
-function to do the indentation tests."
+FILE, in `nix-mode'. INDENT should be the desired value of
+`nix-indent-function'. If it's non-nil, an indentation test
+will be run before executing BODY."
`(with-temp-buffer
;; Read test data file
@@ -48,21 +49,21 @@ function to do the indentation tests."
;; Store the file as a local variable and set the right indentation
function to use
(let ((raw-file (buffer-substring-no-properties (point-min) (point-max)))
- (nix-indent-function 'nix-indent-line)
+ (nix-indent-function
+ ,(or indent `',(default-value 'nix-indent-function)))
(inhibit-message t))
;; Load up nix-mode
(nix-mode)
;; If we're doing an indentation test
(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))))
+ ;; 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)))
;; Go to beginning
(goto-char (point-min))
- [nongnu] elpa/nix-mode 9d4eb7d199 274/500: Make find-file-at-point support <nixpkgs>, (continued)
- [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, 2022/01/29
- [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 <=
- [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
- [nongnu] elpa/nix-mode 30587b2205 411/500: Merge pull request #114 from TristanCacqueray/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 471a90ac96 394/500: Release 1.4.5, ELPA Syncer, 2022/01/29