File: test-funcname-at-point.el

package info (click to toggle)
lua-mode 20250310~git.2f6b8d7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 428 kB
  • sloc: lisp: 3,186; makefile: 40; sh: 21
file content (31 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;;; test-funcname-at-point.el --- Test `lua-funcname-at-point'  -*- lexical-binding:t -*-

;;; 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 "handles identifiers before point"
    (with-temp-buffer
      (insert "table.insert.")
      (expect (lua-funcname-at-point) :to-equal "table.insert"))))

;;; test-funcname-at-point.el ends here