Convert indent test for css-mode into automatic test

* test/lisp/textmodes/css-mode-tests.el (css-mode-test-indent): New
test.
(css-mode-tests-data-dir): New variable.
* test/manual/indent/css-mode.css: Move from here...
* test/lisp/textmodes/css-mode-resources/test-indent.css: ...to here.
This commit is contained in:
Stefan Kangas 2020-09-10 20:40:34 +02:00
parent 498773447a
commit 4ba71eee8d
2 changed files with 14 additions and 0 deletions

View file

@ -30,6 +30,12 @@
(require 'ert)
(require 'seq)
(defvar css-mode-tests-data-dir
(file-truename
(expand-file-name "css-mode-resources/"
(file-name-directory (or load-file-name
buffer-file-name)))))
(ert-deftest css-test-property-values ()
;; The `float' property has a flat value list.
(should
@ -411,5 +417,13 @@
(point))
"black")))))
(ert-deftest css-mode-test-indent ()
(with-current-buffer
(find-file-noselect (expand-file-name "test-indent.css"
css-mode-tests-data-dir))
(let ((orig (buffer-string)))
(indent-region (point-min) (point-max))
(should (equal (buffer-string) orig)))))
(provide 'css-mode-tests)
;;; css-mode-tests.el ends here