diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-01-30 23:37:19 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-01-30 23:37:19 +0900 |
commit | 50c76b844bc79309b4f5d9e28a2386b9a6f735b7 (patch) | |
tree | 29f8273d8afccae1f16b723c36548cee150cb0bc /test/lisp/thingatpt-tests.el | |
parent | 563a0d94c379292bd88e83f18560ed21c497cea9 (diff) | |
parent | 96f20120c97a0a329fff81a0cc3747082a8a2c55 (diff) | |
download | emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.tar.gz emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.tar.bz2 emacs-50c76b844bc79309b4f5d9e28a2386b9a6f735b7.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'test/lisp/thingatpt-tests.el')
-rw-r--r-- | test/lisp/thingatpt-tests.el | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index c43c81af9fd..62a27f09cbd 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -146,4 +146,48 @@ 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 () + (with-temp-buffer + (insert "`[[`(") + (goto-char 2) + (should (eq (symbol-at-point) nil)))) + ;;; thingatpt.el ends here |