diff options
| author | Simen Heggestøyl <simenheg@gmail.com> | 2017-12-16 09:37:11 +0100 |
|---|---|---|
| committer | Simen Heggestøyl <simenheg@gmail.com> | 2017-12-16 09:46:54 +0100 |
| commit | 63b6281fdd9c00c6d968e936289c1e32aa9d0dd3 (patch) | |
| tree | a326fb5cd3db2c34bfa6b154d5b47bf506f55cb7 /test/lisp/textmodes | |
| parent | 804b37ca63ecd68c5359febbedbec120c06918af (diff) | |
| download | emacs-63b6281fdd9c00c6d968e936289c1e32aa9d0dd3.tar.gz | |
Fix off-by-one error in 'css--hex-color'
* lisp/textmodes/css-mode.el (css--hex-color): Fix off-by-one error.
* test/lisp/textmodes/css-mode-tests.el (css-test-hex-color): New test
for 'css--hex-color'.
Diffstat (limited to 'test/lisp/textmodes')
| -rw-r--r-- | test/lisp/textmodes/css-mode-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index 47cf5f9244b..1e58751f140 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el @@ -295,6 +295,12 @@ (insert input ")")) (should (equal (css--hsl-color) "#ff0000"))))) +(ert-deftest css-test-hex-color () + (should (equal (css--hex-color "#abc") "#abc")) + (should (equal (css--hex-color "#abcd") "#abc")) + (should (equal (css--hex-color "#aabbcc") "#aabbcc")) + (should (equal (css--hex-color "#aabbccdd") "#aabbcc"))) + (ert-deftest css-test-named-color () (dolist (text '("@mixin black" "@include black")) (with-temp-buffer |
