aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Belaïche2025-06-27 18:02:17 +0200
committerVincent Belaïche2025-06-28 06:16:23 +0200
commit7843ac6df2a5c0b9917838f2d82072af49dc1669 (patch)
treea6deb25593e0cccf18250094d57600c4444edf6b
parentba07d43bbaea7923385a7c389c71117314c5c262 (diff)
downloademacs-scratch/ses-programmatic-editing.tar.gz
emacs-scratch/ses-programmatic-editing.zip
Add test for ses-range with argument setting browsing direction.scratch/ses-programmatic-editing
-rw-r--r--test/lisp/ses-tests.el40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el
index 5ae69ff685a..865c3cab357 100644
--- a/test/lisp/ses-tests.el
+++ b/test/lisp/ses-tests.el
@@ -547,6 +547,46 @@ cell has to be rewritten to data area."
547 (should (eq A2 2)) 547 (should (eq A2 2))
548 (should (eq B2 4))))) 548 (should (eq B2 4)))))
549 549
550(ert-deftest ses-range-reading-directions ()
551 "Test ses-range with reading directions"
552 (let ((ses-initial-size '(5 . 3))
553 (ses-initial-default-printer "%S")
554 (ses-after-entry-functions nil))
555 (with-temp-buffer
556 (ses-mode)
557 (dolist (c '((0 0 "A1"); A1
558 (1 0 "A2"); A2
559 (0 1 "B1"); B1
560 (1 1 "B2"); B2
561 (2 0 (apply 'concat (ses-range A1 B1 <))); A3
562 (2 1 (apply 'concat (ses-range A1 B1 >))); B3
563 (2 2 (apply 'concat (ses-range A1 B2 >v))); C3
564 (3 0 (apply 'concat (ses-range A1 B2 >^))); A4
565 (3 1 (apply 'concat (ses-range A1 B2 <v))); B4
566 (3 2 (apply 'concat (ses-range A1 B2 <^))); C4
567
568 (0 2 (apply 'concat (ses-range A1 B2 v>))); C1
569 (1 2 (apply 'concat (ses-range A1 B2 ^>))); C2
570 (4 0 (apply 'concat (ses-range A1 B2 v<))); A5
571 (4 1 (apply 'concat (ses-range A1 B2 ^<))); B5
572 ))
573 (apply 'ses-cell-set-formula c)
574 (apply 'ses-calculate-cell (list (car c) (cadr c) nil)))
575 (ses-recalculate-all)
576 (should (string= A3 "B1A1"))
577 (should (string= B3 "A1B1"))
578
579 (should (string= C3 "A1B1A2B2"))
580 (should (string= A4 "A2B2A1B1"))
581 (should (string= B4 "B1A1B2A2"))
582 (should (string= C4 "B2A2B1A1"))
583
584 (should (string= C1 "A1A2B1B2"))
585 (should (string= C2 "A2A1B2B1"))
586 (should (string= A5 "B1B2A1A2"))
587 (should (string= B5 "B2B1A2A1"))
588 )))
589
550(provide 'ses-tests) 590(provide 'ses-tests)
551 591
552;;; ses-tests.el ends here 592;;; ses-tests.el ends here