branch: elpa/tuareg
commit 5eab0de3417585b304478b2d798d527c71278c01
Author: Christophe Troestler <[email protected]>
Commit: Christophe Troestler <[email protected]>
Tests: add commenting then uncommenting tests
---
tuareg-tests.el | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/tuareg-tests.el b/tuareg-tests.el
index b24f495..f248320 100644
--- a/tuareg-tests.el
+++ b/tuareg-tests.el
@@ -625,4 +625,32 @@ Return (FILE TYPE START-LINE END-LINE START-COL END-COL)."
" epsilon\n tau\n")
" (* epsilon\n tau *)\n"))))
+(defun tuareg-test--comment-uncomment-region (text)
+ (equal text
+ (with-temp-buffer
+ (tuareg-mode)
+ (insert text)
+ (comment-region (point-min) (point-max))
+ (uncomment-region (point-min) (point-max))
+ (buffer-string))))
+
+(ert-deftest tuareg-comment-uncomment-region ()
+ "Check that commenting out code then uncommenting it leads to
+the original code."
+ (should (let ((comment-style 'indent))
+ (tuareg-test--comment-uncomment-region
+ "let f x =\n g x\n y\n")))
+ (should (let ((comment-style 'multi-line)
+ (comment-continue " * "))
+ (tuareg-test--comment-uncomment-region
+ "let f x =\n g x\n y\n")))
+ (should (let ((comment-style 'multi-line))
+ (tuareg-test--comment-uncomment-region
+ "let f x =\n g x\n y\n")))
+ (should (let ((comment-style 'multi-line)
+ (comment-continue " "))
+ (tuareg-test--comment-uncomment-region
+ "let f x =\n g x\n y\n"))))
+
+
(provide 'tuareg-tests)