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

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

[nongnu] elpa/nix-mode 0cb2b32485 323/500: Add a failing test that check


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 0cb2b32485 323/500: Add a failing test that checks the indentation of function bodies.
Date: Sat, 29 Jan 2022 08:27:17 -0500 (EST)

branch: elpa/nix-mode
commit 0cb2b324850f4f0725d3641a03c85fe451377d25
Author: Jakub Piecuch <j.piecuch96@gmail.com>
Commit: Jakub Piecuch <j.piecuch96@gmail.com>

    Add a failing test that checks the indentation of function bodies.
---
 tests/nix-mode-tests.el          |  4 ++++
 tests/testcases/smie-lambdas.nix | 26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
index 7aa3995415..a6b3eb68c1 100644
--- a/tests/nix-mode-tests.el
+++ b/tests/nix-mode-tests.el
@@ -188,5 +188,9 @@ Related issue: https://github.com/NixOS/nix-mode/issues/72";
   "Proper indentation of strings in a multi-line string."
   (with-nix-mode-test ("issue-78.nix" :indent 'smie-indent-line)))
 
+(ert-deftest nix-mode-test-indent-lambdas-smie ()
+  "Proper indentation of function bodies."
+  (with-nix-mode-test ("smie-lambdas.nix" :indent 'smie-indent-line)))
+
 (provide 'nix-mode-tests)
 ;;; nix-mode-tests.el ends here
diff --git a/tests/testcases/smie-lambdas.nix b/tests/testcases/smie-lambdas.nix
new file mode 100644
index 0000000000..d33596d6ca
--- /dev/null
+++ b/tests/testcases/smie-lambdas.nix
@@ -0,0 +1,26 @@
+{ foo, bar }:
+{ foo, bar } @ baz:
+foo: bar:
+
+{
+  test1 =
+    { f = x:
+        42 };
+
+  test2 = x:
+    42;
+
+  test3 = map (x:
+    42) [ 1 2 3 ];
+
+  test4 =
+    { f = x: y: z:
+        42 };
+
+  test2 = x: y: z:
+    42;
+
+  test3 = map (x: y: z:
+    42) [ 1 2 3 ];
+}
+



reply via email to

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