From: Eshel Yaron Date: Thu, 17 Nov 2022 19:09:21 +0000 (+0200) Subject: Add test and update manual following change in auto-insert X-Git-Tag: V8.5.20-sweep-0.8.9~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6dd5a5c6590fdf1142bf2afa35c28923d34d4c6e;p=sweep.git Add test and update manual following change in auto-insert --- diff --git a/README.org b/README.org index 7d176a8..5ba7cb7 100644 --- a/README.org +++ b/README.org @@ -853,7 +853,7 @@ As an example, after inserting the module skeleton, a new Prolog file :- module(foo, []). - /** foo + /** ,*/ diff --git a/sweeprolog-tests.el b/sweeprolog-tests.el index 202eb2c..5decdae 100644 --- a/sweeprolog-tests.el +++ b/sweeprolog-tests.el @@ -105,6 +105,20 @@ foo(Foo) :- bar. '(sweeprolog-undefined-default-face sweeprolog-body-default-face))))) +(ert-deftest auto-insert-module-header () + "Tests inserting Prolog module header with `auto-insert'." + (find-file-literally (expand-file-name "sweeprolog_test_auto_insert.pl" + temporary-file-directory)) + (sweeprolog-mode) + (let ((auto-insert-query nil)) + (call-interactively #'auto-insert)) + (let ((end (point))) + (beginning-of-line -1) + (should (string= (buffer-substring-no-properties (point) end) + ":- module(sweeprolog_test_auto_insert, []). + +/** ")))) + (ert-deftest complete-atom () "Tests completing atoms." (let ((temp (make-temp-file "sweeprolog-test"