;;; nxml-mode-tests.el --- Test NXML Mode -*- lexical-binding: t; -*-
;; Copyright (C) 2019 Free Software Foundation, Inc.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see .
;;; Code:
(require 'ert)
(require 'nxml-mode)
(defun nxml-mode-tests-correctly-indented-string (str)
(with-temp-buffer
(nxml-mode)
(insert str)
(indent-region (point-min) (point-max))
(equal (buffer-string) str)))
(ert-deftest nxml-indent-line-after-attribute ()
(should (nxml-mode-tests-correctly-indented-string "
...
"))
(should (nxml-mode-tests-correctly-indented-string "\
")))
(ert-deftest nxml-balanced-close-start-tag-inline ()
(with-temp-buffer
(nxml-mode)
(insert "")
(search-backward "")
(nxml-balanced-close-start-tag-inline)
(should (equal (buffer-string) ""))))
(provide 'nxml-mode-tests)
;;; nxml-mode-tests.el ends here