emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode 7fbde25122 09/14: Add tests for issue 157


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 7fbde25122 09/14: Add tests for issue 157
Date: Tue, 19 Jul 2022 01:58:49 -0400 (EDT)

branch: elpa/nix-mode
commit 7fbde25122c20ed3729f33aab6545449d3e6e0dc
Author: Nicholas Coltharp <coltharp@pdx.edu>
Commit: Nicholas Coltharp <coltharp@pdx.edu>

    Add tests for issue 157
    
    - `''` escapes `$` in both single- and double-quoted strings.
    - `$$` cannot start an antiquote.
    - In a double-quoted string, `\$$` cannot start an antiquote.
    - In a single-quoted string, `\$$` *can* start an antiquote.
---
 tests/nix-font-lock-tests.el | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tests/nix-font-lock-tests.el b/tests/nix-font-lock-tests.el
index 5abdb5744f..619ee78f56 100644
--- a/tests/nix-font-lock-tests.el
+++ b/tests/nix-font-lock-tests.el
@@ -81,6 +81,30 @@ if all of its characters have syntax and face. See
      ("with" t nix-keyword-face)
      ("foo" t nix-attribute-face))))
 
+(ert-deftest nix-issue-157 ()
+  (check-properties
+   '("\"''$${x}")
+   '(("\"''$${x}" t font-lock-string-face)))
+  (check-properties
+   '("''''$${x}''")
+   '(("''''$" t font-lock-string-face)
+     ("${" t nix-antiquote-face)
+     ("}" t nix-antiquote-face)))
+  (check-properties
+   '("\"$${x}\"")
+   '(("\"$${x}\"" t font-lock-string-face)))
+  (check-properties
+   '("''$${x}''")
+   '(("''$${x}''" t font-lock-string-face)))
+  (check-properties
+   '("\"\\$${x}\"")
+   '(("\"\\$" t font-lock-string-face)
+     ("${" t nix-antiquote-face)
+     ("}" t nix-antiquote-face)))
+  (check-properties
+   '("''\\$${x}''")
+   '(("''\\$${x}''" t font-lock-string-face))))
+
 ;; Local Variables:
 ;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)
 ;; End:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]