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

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

[nongnu] elpa/lua-mode 3a0fb4b 431/468: `lua-funcname-at-point': add tes


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 3a0fb4b 431/468: `lua-funcname-at-point': add tests
Date: Thu, 5 Aug 2021 04:59:23 -0400 (EDT)

branch: elpa/lua-mode
commit 3a0fb4bfe83f6702eba9f84991c7eb3b3b3fc5f7
Author: Nikita Bloshchanevich <nikblos@outlook.com>
Commit: Nikita Bloshchanevich <nikblos@outlook.com>

    `lua-funcname-at-point': add tests
---
 test/test-funcname-at-point.el | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/test/test-funcname-at-point.el b/test/test-funcname-at-point.el
new file mode 100644
index 0000000..a73b368
--- /dev/null
+++ b/test/test-funcname-at-point.el
@@ -0,0 +1,31 @@
+;;; test-funcname-at-point.el --- Test `lua-funcname-at-point'
+
+;;; Commentary:
+
+;; Ensure that `lua-funcname-at-point' works correctly in all intended
+;; circumstances.
+
+;;; Code:
+
+(describe "Test `lua-funcname-at-point'."
+  (it "handles trailing periods"
+    (with-temp-buffer
+      (insert "table.insert.")
+      (backward-char)
+      (expect (lua-funcname-at-point) :to-equal "table.insert")))
+  (it "handles point being in the middle"
+    (with-temp-buffer
+      (insert "table.")
+      (save-excursion
+        (insert "insert."))
+      (expect (lua-funcname-at-point) :to-equal "table.insert")))
+  (it "handles point being at the start of the buffer"
+    (with-temp-buffer
+      (save-excursion (insert "table.insert."))
+      (expect (lua-funcname-at-point) :to-equal "table.insert")))
+  (it "ignores identifiers before point"
+    (with-temp-buffer
+      (insert "table.insert.")
+      (expect (lua-funcname-at-point) :to-be nil))))
+
+;;; test-funcname-at-point.el ends here



reply via email to

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