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

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

[nongnu] elpa/tuareg 3e943c3 01/10: Tests commenting: move the `should'


From: ELPA Syncer
Subject: [nongnu] elpa/tuareg 3e943c3 01/10: Tests commenting: move the `should' outside `let'
Date: Fri, 27 Aug 2021 09:57:35 -0400 (EDT)

branch: elpa/tuareg
commit 3e943c3b52519c68b7ffcfe6389297c261c2e844
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    Tests commenting: move the `should' outside `let'
    
    This makes it easier to spot which test fails.
---
 tuareg-tests.el | 37 +++++++++++++++++++++----------------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/tuareg-tests.el b/tuareg-tests.el
index 6c7c523..7118a4b 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -578,33 +578,38 @@ Return (FILE TYPE START-LINE END-LINE START-COL END-COL)."
 (ert-deftest tuareg-comment-region-style ()
   "Check that commenting out code works as expected. See issue #216."
   ;; Non-indented code.
-  (let ((comment-style 'indent))
-    (should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'indent))
+            (equal (tuareg-test--comment-region
                     "let f x =\n  g x\n    y\n")
                    "(* let f x = *)\n(*   g x *)\n(*     y *)\n")))
-  (let ((comment-style 'multi-line)
-        (comment-continue " * "))
-    (should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line)
+                (comment-continue " * "))
+            (equal (tuareg-test--comment-region
                     "let f x =\n  g x\n    y\n")
                    "(* let f x =\n *   g x\n *     y *)\n")))
-  (let ((comment-style 'multi-line)
-        (comment-continue "   "))
-    (should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line))
+            ;; `comment-continue' should default to " * "
+            (equal (tuareg-test--comment-region
+                    "let f x =\n  g x\n    y\n")
+                   "(* let f x =\n *   g x\n *     y *)\n")))
+  (should (let ((comment-style 'multi-line)
+                (comment-continue "   "))
+            (equal (tuareg-test--comment-region
                     "let f x =\n  g x\n    y\n")
                    "(* let f x =\n     g x\n       y *)\n")))
   ;; Indented code.
-  (let ((comment-style 'indent))
-    (should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'indent))
+            (equal (tuareg-test--comment-region
                     "  epsilon\n    tau\n")
                    "  (* epsilon *)\n  (*   tau *)\n")))
-  (let ((comment-style 'multi-line)
-        (comment-continue " * "))
-    (should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line)
+                (comment-continue " * "))
+            (equal (tuareg-test--comment-region
                     "  epsilon\n    tau\n")
                    "  (* epsilon\n   *   tau *)\n")))
-  (let ((comment-style 'multi-line)
-        (comment-continue "   "))
-    (should (equal (tuareg-test--comment-region
+  (should (let ((comment-style 'multi-line)
+                (comment-continue "   "))
+            (equal (tuareg-test--comment-region
                     "  epsilon\n    tau\n")
                    "  (* epsilon\n       tau *)\n"))))
 



reply via email to

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