From: Eshel Yaron Date: Thu, 1 Jun 2023 15:26:47 +0000 (+0300) Subject: Test 'sweeprolog-make-example-usage-comment' X-Git-Tag: V9.1.10-sweep-0.18.4~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=691fb59c0e3d3102f6311aeb67815ae3b4725b19;p=sweep.git Test 'sweeprolog-make-example-usage-comment' --- diff --git a/sweeprolog-tests.el b/sweeprolog-tests.el index 2748ee0..d8ad5e2 100644 --- a/sweeprolog-tests.el +++ b/sweeprolog-tests.el @@ -1803,4 +1803,19 @@ head, (sweeprolog--backward-sexp) (should (= (point) 4)))) +(ert-deftest usage-example-comment () + "Tests adding usage example comments." + (with-temp-buffer + (sweeprolog-mode) + (insert "\nfoo.") + (let ((source-buffer (current-buffer))) + (sweeprolog-make-example-usage-comment (point-min)) + (insert "true; false.") + (comint-send-input) + (accept-process-output nil 1) + (sweeprolog-top-level-example-done) + (with-current-buffer source-buffer + (should (string= (buffer-string) + "% ?- true; false.\n% true\u0020\nfoo.")))))) + ;;; sweeprolog-tests.el ends here