[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 9c275cd 419/468: Add regression test for issue #1
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 9c275cd 419/468: Add regression test for issue #157, fix lua-get-line-faces |
Date: |
Thu, 5 Aug 2021 04:59:21 -0400 (EDT) |
branch: elpa/lua-mode
commit 9c275cd3cd1b4a14e3079adf223d616bb452e057
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Add regression test for issue #157, fix lua-get-line-faces
---
test/test-font-lock.el | 9 +++++++++
test/utils.el | 24 +++++++++++++-----------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/test/test-font-lock.el b/test/test-font-lock.el
index 5b9cfce..8fbb974 100644
--- a/test/test-font-lock.el
+++ b/test/test-font-lock.el
@@ -100,6 +100,15 @@ foo = bar"
()
())))
+ (it "does not fontify \"for\" inside strings"
+ ;; Issue #157
+ (expect "local xx = [[
+for abc def
+]]"
+ :to-be-fontified-as '(("local" keyword "xx" variable-name "[["
string)
+ ("for abc def" string)
+ ("]]" string))))
+
(it "fontifies \"for x123 =\""
(expect "for x123 ="
:to-be-fontified-as '(("for" keyword "x123" variable-name))))
diff --git a/test/utils.el b/test/utils.el
index 4192db0..6b05737 100644
--- a/test/utils.el
+++ b/test/utils.el
@@ -56,16 +56,17 @@ E.g. for properly fontified Lua string \"local x = 100\" it
should return
\"x\" font-lock-variable-name-face
\"100\" font-lock-constant-face)
"
- (let ((pos 0)
- nextpos
- result prop newprop)
- (while pos
- (setq nextpos (next-property-change pos str)
- newprop (or (get-text-property pos 'face str)
- (get-text-property pos 'font-lock-face str)))
+ (let* ((pos 0)
+ (prop (or (get-text-property pos 'face str)
+ (get-text-property pos 'font-lock-face str)))
+ (nextpos 0)
+ newprop
+ result)
+ (while nextpos
+ (setq nextpos (next-property-change nextpos str))
+ (setq newprop (when nextpos (or (get-text-property nextpos 'face str)
+ (get-text-property nextpos
'font-lock-face str))))
(when (not (equal prop newprop))
- (setq prop newprop)
-
(when (listp prop)
(when (eq (car-safe (last prop)) 'default)
(setq prop (butlast prop)))
@@ -76,8 +77,9 @@ E.g. for properly fontified Lua string \"local x = 100\" it
should return
(setq prop nil))))
(when prop
(push (substring-no-properties str pos nextpos) result)
- (push prop result)))
- (setq pos nextpos))
+ (push prop result))
+ (setq prop newprop
+ pos nextpos)))
(nreverse result)))
(defun lua-fontify-str (str)
- [nongnu] elpa/lua-mode 1f04654 379/468: travis: enable testing on osx, (continued)
- [nongnu] elpa/lua-mode 1f04654 379/468: travis: enable testing on osx, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eb93be5 380/468: Merge pull request #158 from immerrr/enable-testing-on-osx, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4cdee31 388/468: Use proper lexical-bindings instead of lexical-let*, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5dfc5be 399/468: Merge pull request #168 from immerrr/index-requires-as-imenu-items, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a3a71b1 400/468: Merge pull request #151 from edam/indent-nested-blocks, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 35b6e4c 402/468: Merge pull request #169 from tarsiiformes/typos, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 724bfa5 409/468: Fix support for file-local vars in indentation tests, add tests for blocks, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1365ba0 412/468: Enable XFAIL-ing tests for continuation in block intros, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 51a32ef 417/468: Merge pull request #176 from immerrr/improve-indentation-for-continuation-lines, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b37710e 418/468: Enable fontification of variable names in "for" and function parameters, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9c275cd 419/468: Add regression test for issue #157, fix lua-get-line-faces,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 5fe5f57 422/468: Fix wait-for-prompt to take lua-prompt-regexp into account, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 83ec53d 430/468: `lua-funcname-at-point': be more strict, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 70b9384 448/468: Don't evaluate lua-is-continuing-statement-p-1 twice, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 350acce 450/468: Don't do lua-backward-up-list calculation for overrides if not necessary, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3e89784 454/468: Fix test suite names, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode af274e4 455/468: Merge pull request #184 from immerrr/fix-and-optimize-finding-matching-blocks, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d81c700 466/468: Bump version tag, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b9a476c 467/468: Merge pull request #194 from phikal/patch-1, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 28155ba 241/468: Update README.md, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 45a881d 243/468: lua-search-documentation: fix 'foo.bar' lookups broken when making '.' punctuation, Philip Kaludercic, 2021/08/05