Skip to content

Commit 218463b

Browse files
committed
Add unit test suite, disable test-checks
Reflects the decisions we made over #493. Code has been copied as is, except for the unit tests in question, which are for `cljr--ns-name` (as a random example that I picked).
1 parent af1bde5 commit 218463b

File tree

6 files changed

+28
-14
lines changed

6 files changed

+28
-14
lines changed

.circleci/config.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ default: &default-steps
99
- run: make elpa
1010
- run: emacs --version
1111
- run: cask --version
12+
- run: make unit
1213
- run: make test
1314
# Make sure to run test-checks before test-bytecomp, as test-bytecomp autogenerates
1415
# files which won't pass test-checks.
15-
- run: make test-checks
16-
- run: make test-bytecomp
16+
# disabled - see https://github.com/clojure-emacs/clj-refactor.el/issues/491
17+
#- run: make test-checks
18+
#- run: make test-bytecomp
1719

1820
# Enumerated list of Emacs versions
1921
jobs:

Cask

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55

66
(development
77
(depends-on "ecukes")
8-
(depends-on "espuds"))
8+
(depends-on "espuds")
9+
(depends-on "buttercup"))

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ clean:
3131
test: $(PKGDIR)
3232
$(CASK) exec ecukes --no-win
3333

34+
unit:
35+
$(CASK) exec buttercup -L .
36+
3437
test-checks:
3538
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \
3639
-l test/test-checks.el ./

feature/feature.el

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(provide 'feature)

test/test-checks.el

+12-11
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
(setq checkdoc-arguments-in-order-flag nil)
1616
(setq checkdoc-verb-check-experimental-flag nil)
1717

18-
(let ((files (directory-files default-directory t
19-
"\\`[^.].*\\.el\\'" t)))
18+
(when nil ;; See https://github.com/clojure-emacs/clj-refactor.el/issues/491
19+
(let ((files (directory-files default-directory t
20+
"\\`[^.].*\\.el\\'" t)))
2021

21-
;; `checkdoc-file' was introduced in Emacs 25
22-
(when (fboundp 'checkdoc-file)
23-
(dolist (file files)
24-
(checkdoc-file file))
25-
(when (get-buffer "*Warnings*")
26-
(message "Failing due to checkdoc warnings...")
27-
(kill-emacs 1)))
22+
;; `checkdoc-file' was introduced in Emacs 25
23+
(when (fboundp 'checkdoc-file)
24+
(dolist (file files)
25+
(checkdoc-file file))
26+
(when (get-buffer "*Warnings*")
27+
(message "Failing due to checkdoc warnings...")
28+
(kill-emacs 1)))
2829

29-
(when (apply #'check-declare-files files)
30-
(kill-emacs 1)))
30+
(when (apply #'check-declare-files files)
31+
(kill-emacs 1))))

tests/unit-test.el

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(require 'paredit)
2+
(require 'clj-refactor)
3+
4+
(describe "cljr--ns-name"
5+
(expect (cljr--ns-name "com.corp.foo") :to-be "foo")
6+
(expect (cljr--ns-name "foo") :to-be "foo"))

0 commit comments

Comments
 (0)