Skip to content

Commit

Permalink
Run all tests in GH CI
Browse files Browse the repository at this point in the history
And fix go-fill-paragraph-test.el to pass from the command line. Not
sure exactly what is wrong, but fill-paragraph wasn't doing the right
thing with a region selected when invoked from the command line. There
could be a real bug here, but I wasn't able to reproduce the failures
functionally in Emacs.

Closes: dominikh#308 [via git-merge-pr]
  • Loading branch information
muirdm authored and psanford committed Oct 16, 2019
1 parent 2a1584f commit 839190b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/emacs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
uses: actions/checkout@v1

- name: Test
run: cd test; emacs --batch -q -l ert -l ../go-mode.el -l go-indentation-test.el -f ert-run-tests-batch-and-exit
run: cd test; emacs --batch -q -l ert -l ../go-mode.el $(for t in *-test.el; do echo -n "-l $t "; done) -f ert-run-tests-batch-and-exit
11 changes: 8 additions & 3 deletions test/go-fill-paragraph-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
;; Use of this source code is governed by a BSD-style
;; license that can be found in the LICENSE file.

(require 'ert)
(require 'go-mode)

(defun go--should-fill (got expected)
"Run `fill-paragraph' against GOT and make sure it matches EXPECTED.
Expand All @@ -15,9 +18,11 @@ represents point and mark to test the region based fill-paragraph."
(goto-char (point-min))
(let ((beg (progn (search-forward "<") (delete-char -1) (point)))
(end (progn (search-forward ">") (delete-char -1) (point))))
(when (/= beg end)
(set-mark beg))
(call-interactively 'fill-paragraph)
(if (/= beg end)
(progn
(set-mark beg)
(call-interactively 'fill-region))
(call-interactively 'fill-paragraph))
(should (string= (buffer-string) expected)))))

(ert-deftest go--fill-paragraph-no-comment ()
Expand Down

0 comments on commit 839190b

Please sign in to comment.