diff options
Diffstat (limited to 'test/lisp/ses-tests.el')
-rw-r--r-- | test/lisp/ses-tests.el | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el index cd524cbf6e0..b60ddeea78e 100644 --- a/test/lisp/ses-tests.el +++ b/test/lisp/ses-tests.el @@ -178,6 +178,61 @@ to `ses--bar' and inserting a row, makes A2 value empty, and `ses--bar' equal to (should (eq ses--bar 2))))) +;; JUMP tests +;; ====================================================================== +(ert-deftest ses-jump-B2-prefix-arg () + "Test jumping to cell B2 by use of prefix argument" + (let ((ses-initial-size '(3 . 3)) + ses-after-entry-functions) + (with-temp-buffer + (ses-mode) + ;; C-u 4 M-x ses-jump + (let ((current-prefix-arg 4)) + (call-interactively 'ses-jump)) + (should (eq (ses--cell-at-pos (point)) 'B2))))) + + +(ert-deftest ses-jump-B2-lowcase () + "Test jumping to cell B2 by use of lowcase cell name string" + (let ((ses-initial-size '(3 . 3)) + ses-after-entry-functions) + (with-temp-buffer + (ses-mode) + (funcall-interactively 'ses-jump "b2") + (ses-command-hook) + (should (eq (ses--cell-at-pos (point)) 'B2))))) + +(ert-deftest ses-jump-B2-lowcase-keys () + "Test jumping to cell B2 by use of lowcase cell name string with simulating keys" + (let ((ses-initial-size '(3 . 3)) + ses-after-entry-functions) + (with-temp-buffer + (ses-mode) + (ert-simulate-keys [ ?b ?2 return] (ses-jump)) + (ses-command-hook) + (should (eq (ses--cell-at-pos (point)) 'B2))))) + +(ert-deftest ses-jump-B2-symbol () + "Test jumping to cell B2 by use of cell name symbol" + (let ((ses-initial-size '(3 . 3)) + ses-after-entry-functions) + (with-temp-buffer + (ses-mode) + (funcall-interactively 'ses-jump 'B2) + (ses-command-hook) + (should (eq (ses--cell-at-pos (point)) 'B2))))) + +(ert-deftest ses-jump-B2-renamed () + "Test jumping to cell B2 after renaming it `ses--toto'." + (let ((ses-initial-size '(3 . 3)) + ses-after-entry-functions) + (with-temp-buffer + (ses-mode) + (ses-rename-cell 'ses--toto (ses-get-cell 1 1)) + (ses-jump 'ses--toto) + (ses-command-hook) + (should (eq (ses--cell-at-pos (point)) 'ses--toto))))) + (provide 'ses-tests) ;;; ses-tests.el ends here |