From 6dd5a5c6590fdf1142bf2afa35c28923d34d4c6e Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 17 Nov 2022 21:09:21 +0200 Subject: [PATCH] Add test and update manual following change in auto-insert --- README.org | 2 +- sweeprolog-tests.el | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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" -- 2.39.2