branch: elpa/nix-mode
commit a18a226ce9edbea63c63eb5acbf2f418d342d50b
Author: Matthew Bauer <[email protected]>
Commit: Matthew Bauer <[email protected]>

    Add nix-mode tests.
---
 tests/nix-mode-tests.el | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tests/nix-mode-tests.el b/tests/nix-mode-tests.el
new file mode 100644
index 0000000000..3c004bb1a6
--- /dev/null
+++ b/tests/nix-mode-tests.el
@@ -0,0 +1,23 @@
+(require 'ert)
+(require 'nix-mode)
+
+(ert-deftest nix-mode-quote-detection ()
+  (should (with-temp-buffer
+            (nix-mode)
+            (insert "'' ")
+            (save-excursion (insert " ''"))
+            (eq (nix--get-string-type (nix--get-parse-state (point))) ?\'))))
+
+(ert-deftest nix-mode-quote2-detection ()
+  (should (with-temp-buffer
+            (nix-mode)
+            (insert "\"")
+            (save-excursion (insert "\""))
+            (eq (nix--get-string-type (nix--get-parse-state (point))) ?\"))))
+
+(ert-deftest nix-mode-quote3-detection ()
+  (should (with-temp-buffer
+            (nix-mode)
+            (eq (nix--get-string-type (nix--get-parse-state (point))) nil))))
+
+(provide 'nix-mode-tests)

Reply via email to