Commit 0f9a78e7 authored by Simen Heggestøyl's avatar Simen Heggestøyl
Browse files

Add tests for `css-current-defun-name'

* test/lisp/textmodes/css-mode-tests.el (css-test-current-defun-name)
(css-test-current-defun-name-nested)
(css-test-current-defun-name-complex): New tests for
`css-current-defun-name'.
parent 88a0dd71
......@@ -80,6 +80,27 @@
(equal (seq-sort #'string-lessp (css--value-class-lookup 'position))
'("bottom" "calc()" "center" "left" "right" "top"))))
(ert-deftest css-test-current-defun-name ()
(with-temp-buffer
(insert "body { top: 0; }")
(goto-char 7)
(should (equal (css-current-defun-name) "body"))
(goto-char 18)
(should (equal (css-current-defun-name) "body"))))
(ert-deftest css-test-current-defun-name-nested ()
(with-temp-buffer
(insert "body > .main a { top: 0; }")
(goto-char 20)
(should (equal (css-current-defun-name) "body > .main a"))))
(ert-deftest css-test-current-defun-name-complex ()
(with-temp-buffer
(insert "input[type=submit]:hover { color: red; }")
(goto-char 30)
(should (equal (css-current-defun-name)
"input[type=submit]:hover"))))
;;; Completion
(defun css-mode-tests--completions ()
......
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