emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0ffcfd015d3 1/3: Add test reproducting bug #5852


From: Vincent Belaïche
Subject: master 0ffcfd015d3 1/3: Add test reproducting bug #5852
Date: Fri, 29 Dec 2023 06:42:05 -0500 (EST)

branch: master
commit 0ffcfd015d383e4f04ea41af7ac480a27c6f5da5
Author: Vincent Belaïche <vincentb1@users.sourceforge.net>
Commit: Vincent Belaïche <vincentb1@users.sourceforge.net>

    Add test reproducting bug #5852
---
 test/lisp/ses-tests.el | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el
index a941605a4d8..3cc48f8a34d 100644
--- a/test/lisp/ses-tests.el
+++ b/test/lisp/ses-tests.el
@@ -241,6 +241,38 @@ to `ses--bar' and inserting a row, makes A2 value empty, 
and `ses--bar' equal to
       (ses-command-hook)
       (should (eq (ses--cell-at-pos (point)) 'ses--toto)))))
 
+(ert-deftest ses-bug5852 ()
+  "This this bug is not yet fixed, the test is expected to fail.
+The bug is that after the second yank of the same formula the
+reference list of cell B2 is correct in the memory data
+structure, but not in the written ses-cell macros in the data
+area, this is why the second should statement fails after
+reloading the sheet."
+  :expected-result :failed
+  (let ((ses-initial-size '(4 . 3))
+        ses-after-entry-functions beg)
+    (with-temp-buffer
+      (ses-mode)
+      (dolist (c '((0 1 1); B1
+                   (1 0 2) (1 1 (+ B1 A2)); A2 B2
+                   (2 0 4); A3
+                   (3 0 3) (3 1 (+ B2 A4))));A4 B4
+        (apply 'ses-cell-set-formula c)
+        (apply 'ses-calculate-cell (list (car c) (cadr c) nil)))
+      (ses-jump 'B2)
+      (setq beg (point))
+      (ses-jump 'C2)
+      (kill-ring-save beg (point))
+      (ses-jump 'B3)
+      (yank)
+      (ses-command-hook)
+      (ses-jump 'B4)
+      (yank)
+      (ses-command-hook)
+      (should (equal (ses-cell-references 1 1) '(B3)))
+      (ses-mode)
+      (should (equal (ses-cell-references 1 1) '(B3))))))
+
 (provide 'ses-tests)
 
 ;;; ses-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]