aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2023-08-01 12:18:12 +0200
committerStefan Kangas2023-08-01 14:39:30 +0200
commit742104abd7b0b9c417e4bbf3fcda684595375c27 (patch)
treebdd2bf7c28842e0fa0b00052f47aa8b4e3d7463e /test
parenta3979a664304006afa0761884ae0927d269c698c (diff)
downloademacs-742104abd7b0b9c417e4bbf3fcda684595375c27.tar.gz
emacs-742104abd7b0b9c417e4bbf3fcda684595375c27.zip
Fix font locking of booleans in conf-toml-mode
* lisp/textmodes/conf-mode.el (conf-toml-mode): Do not use case folding when font locking. * test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode): Expand test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/textmodes/conf-mode-tests.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/lisp/textmodes/conf-mode-tests.el b/test/lisp/textmodes/conf-mode-tests.el
index 1f6d9b6b587..677a6d35d66 100644
--- a/test/lisp/textmodes/conf-mode-tests.el
+++ b/test/lisp/textmodes/conf-mode-tests.el
@@ -158,7 +158,6 @@ image/tiff tiff tif
158 (should-not (face-at-point)))) 158 (should-not (face-at-point))))
159 159
160(ert-deftest conf-test-toml-mode () 160(ert-deftest conf-test-toml-mode ()
161 ;; From `conf-toml-mode' docstring.
162 (with-temp-buffer 161 (with-temp-buffer
163 (insert "[entry] 162 (insert "[entry]
164value = \"some string\"") 163value = \"some string\"")
@@ -174,6 +173,22 @@ value = \"some string\"")
174 (search-forward "som") 173 (search-forward "som")
175 (should (equal (face-at-point) 'font-lock-string-face)))) 174 (should (equal (face-at-point) 'font-lock-string-face))))
176 175
176(ert-deftest conf-test-toml-mode/boolean ()
177 ;; https://toml.io/en/v1.0.0#boolean
178 (with-temp-buffer
179 (insert "[entry]
180a = true
181b = True")
182 (goto-char (point-min))
183 (conf-toml-mode)
184 (font-lock-mode)
185 (font-lock-ensure)
186 (search-forward "tru")
187 (should (equal (face-at-point) 'font-lock-keyword-face))
188 ;; Do not fontify upper-case "True".
189 (search-forward "Tru")
190 (should (equal (face-at-point) nil))))
191
177(ert-deftest conf-test-desktop-mode () 192(ert-deftest conf-test-desktop-mode ()
178 ;; From `conf-desktop-mode' dostring. 193 ;; From `conf-desktop-mode' dostring.
179 (with-temp-buffer 194 (with-temp-buffer