[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ce1a42a: Add tests for symbol-at-point (bug#14234)
From: |
Lars Ingebrigtsen |
Subject: |
master ce1a42a: Add tests for symbol-at-point (bug#14234) |
Date: |
Wed, 20 Jan 2021 10:47:50 -0500 (EST) |
branch: master
commit ce1a42a6eb41ab7a4473de9e8d8961498568576a
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Add tests for symbol-at-point (bug#14234)
---
test/lisp/thingatpt-tests.el | 45 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index c43c81a..8eec853 100644
--- a/test/lisp/thingatpt-tests.el
+++ b/test/lisp/thingatpt-tests.el
@@ -146,4 +146,49 @@ position to retrieve THING.")
(should (thing-at-point-looking-at "2abcd"))
(should (equal (match-data) m2)))))
+(ert-deftest test-symbol-thing-1 ()
+ (with-temp-buffer
+ (insert "foo bar zot")
+ (goto-char 4)
+ (should (eq (symbol-at-point) 'foo))
+ (forward-char 1)
+ (should (eq (symbol-at-point) 'bar))
+ (forward-char 1)
+ (should (eq (symbol-at-point) 'bar))
+ (forward-char 1)
+ (should (eq (symbol-at-point) 'bar))
+ (forward-char 1)
+ (should (eq (symbol-at-point) 'bar))
+ (forward-char 1)
+ (should (eq (symbol-at-point) 'zot))))
+
+(ert-deftest test-symbol-thing-2 ()
+ (with-temp-buffer
+ (insert " bar ")
+ (goto-char (point-max))
+ (should (eq (symbol-at-point) nil))
+ (forward-char -1)
+ (should (eq (symbol-at-point) 'bar))))
+
+(ert-deftest test-symbol-thing-2 ()
+ (with-temp-buffer
+ (insert " bar ")
+ (goto-char (point-max))
+ (should (eq (symbol-at-point) nil))
+ (forward-char -1)
+ (should (eq (symbol-at-point) 'bar))))
+
+(ert-deftest test-symbol-thing-3 ()
+ (with-temp-buffer
+ (insert "bar")
+ (goto-char 2)
+ (should (eq (symbol-at-point) 'bar))))
+
+(ert-deftest test-symbol-thing-3 ()
+ :expected-result :failed ; FIXME bug#14234
+ (with-temp-buffer
+ (insert "`[[`(")
+ (goto-char 2)
+ (should (eq (symbol-at-point) nil))))
+
;;; thingatpt.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master ce1a42a: Add tests for symbol-at-point (bug#14234),
Lars Ingebrigtsen <=