Commit 20859700 authored by Sebastian Wiesner's avatar Sebastian Wiesner

Add tests for proper indentation of source/test code

parent 210dcdea
......@@ -10,6 +10,7 @@
(depends-on "ert") ; Unit test library
(depends-on "ert-runner") ; Unit test runner
(depends-on "shut-up") ; Silence Emacs
;; Make optional dependencies available for development
(depends-on "google-this") ; Search for messages
......@@ -43,8 +43,10 @@
(require 'flycheck)
(require 'dash)
(require 'f)
(require 'cl-lib)
(require 'epa-file) ; To test encrypted buffers
(require 'ert) ; Unit test library
(require 'shut-up) ; Silence Emacs
;; Optional dependencies
(require 'projectile nil 'no-error)
......@@ -396,6 +398,27 @@ check with. ERRORS is the list of expected errors."
(and (flycheck-test-travis-ci-p) (ert-test-failed-p result)))
;;; Code style
(ert-deftest flycheck-code-style/source-properly-indented ()
:tags '(style)
(cl-letf ((flycheck (f-join flycheck-test-source-directory "flycheck.el"))
((get 'with-demoted-errors 'lisp-indent-function) 1))
(flycheck-test-with-file-buffer flycheck
(indent-region (point-min) (point-max)))
(should (not (buffer-modified-p))))))
(ert-deftest flycheck-code-style/test-suite-properly-indented ()
:tags '(style)
(let ((flycheck-test (f-join flycheck-test-directory "flycheck-test.el")))
(flycheck-test-with-file-buffer flycheck-test
(indent-region (point-min) (point-max)))
(should (not (buffer-modified-p))))))
;;; Customization
(ert-deftest flycheck-checkers/there-are-registered-checkers ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment