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
|