summaryrefslogtreecommitdiff
path: root/test/lisp/textmodes
diff options
context:
space:
mode:
authorSimen Heggestøyl <simenheg@gmail.com>2016-04-24 11:03:22 +0200
committerSimen Heggestøyl <simenheg@gmail.com>2016-04-24 15:02:05 +0200
commit8e2e252932faf3320f72a0b62136c4606e09ebc3 (patch)
treeaaaaa5b71b2b8ac3fbfc6b27985f1b07c71ce43c /test/lisp/textmodes
parent5cb7620027f78a3a0f473972a0584c8ea1791398 (diff)
downloademacs-8e2e252932faf3320f72a0b62136c4606e09ebc3.tar.gz
emacs-8e2e252932faf3320f72a0b62136c4606e09ebc3.tar.bz2
emacs-8e2e252932faf3320f72a0b62136c4606e09ebc3.zip
Cache results of `css--property-values'
* lisp/textmodes/css-mode.el (css--property-values): Cache computed values. * test/lisp/textmodes/css-mode-tests.el (css-test-property-value-cache): New regression test for the above.
Diffstat (limited to 'test/lisp/textmodes')
-rw-r--r--test/lisp/textmodes/css-mode-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el
index 9c5953db4a8..805364c9f42 100644
--- a/test/lisp/textmodes/css-mode-tests.el
+++ b/test/lisp/textmodes/css-mode-tests.el
@@ -57,6 +57,13 @@
;; because it refers to the value class of the same name.
(should (= (length (css--property-values "color")) 18)))
+(ert-deftest css-test-property-value-cache ()
+ "Test that `css--property-value-cache' is in use."
+ (should-not (gethash "word-wrap" css--property-value-cache))
+ (let ((word-wrap-values (css--property-values "word-wrap")))
+ (should (equal (gethash "word-wrap" css--property-value-cache)
+ word-wrap-values))))
+
(ert-deftest css-test-value-class-lookup ()
(should
(equal (sort (css--value-class-lookup 'position) #'string-lessp)