[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select e2aebb9 090/218: * test/lisp/ses-tests
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select e2aebb9 090/218: * test/lisp/ses-tests.el: Quieten compilation. |
Date: |
Fri, 14 Dec 2018 03:35:08 -0500 (EST) |
branch: feature/gnus-select
commit e2aebb9aac8418a19f22d0ffa475f604cb4dee4d
Author: Glenn Morris <address@hidden>
Commit: Andrew G Cohen <address@hidden>
* test/lisp/ses-tests.el: Quieten compilation.
---
test/lisp/ses-tests.el | 79 +++++++++++++++++++++++++++-----------------------
1 file changed, 42 insertions(+), 37 deletions(-)
diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el
index d08237e..c773c9b 100644
--- a/test/lisp/ses-tests.el
+++ b/test/lisp/ses-tests.el
@@ -38,7 +38,7 @@ interactively."
(dolist (c '((0 0 1) (1 0 (1+ A1))))
(apply 'ses-cell-set-formula c)
(apply 'ses-calculate-cell (list (car c) (cadr c) nil)))
- (should (eq A2 2)))))
+ (should (eq (bound-and-true-p A2) 2)))))
(ert-deftest ses-tests-plain-formula ()
"Check that setting A1 to 1 and A2 to (1+ A1), makes A2 value
@@ -49,13 +49,16 @@ equal to 2. This is done using interactive calls."
(dolist (c '((0 0 1) (1 0 (1+ A1))))
(apply 'funcall-interactively 'ses-edit-cell c))
(ses-command-hook)
- (should (eq A2 2)))))
+ (should (eq (bound-and-true-p A2) 2)))))
;; PLAIN CELL RENAMING TESTS
;; ======================================================================
+(defvar ses--foo)
+(defvar ses--cells)
+
(ert-deftest ses-tests-lowlevel-renamed-cell ()
- "Check that renaming A1 to `foo' and setting `foo' to 1 and A2 to (1+ foo),
makes A2 value equal to 2.
+ "Check that renaming A1 to `ses--foo' and setting `ses--foo' to 1 and A2 to
(1+ ses--foo), makes A2 value equal to 2.
This is done using low level functions, `ses-rename-cell' is not
called but instead we use text replacement in the buffer
previously passed in text mode."
@@ -69,63 +72,63 @@ previously passed in text mode."
(text-mode)
(goto-char (point-min))
(while (re-search-forward "\\<A1\\>" nil t)
- (replace-match "foo" t t))
+ (replace-match "ses--foo" t t))
(ses-mode)
(should-not (local-variable-p 'A1))
- (should (eq foo 1))
- (should (equal (ses-cell-formula 1 0) '(ses-safe-formula (1+ foo))))
- (should (eq A2 2)))))
+ (should (eq ses--foo 1))
+ (should (equal (ses-cell-formula 1 0) '(ses-safe-formula (1+ ses--foo))))
+ (should (eq (bound-and-true-p A2) 2)))))
(ert-deftest ses-tests-renamed-cell ()
- "Check that renaming A1 to `foo' and setting `foo' to 1 and A2
-to (1+ foo), makes A2 value equal to 2."
+ "Check that renaming A1 to `ses--foo' and setting `ses--foo' to 1 and A2
+to (1+ ses--foo), makes A2 value equal to 2."
(let ((ses-initial-size '(2 . 1)))
(with-temp-buffer
(ses-mode)
- (ses-rename-cell 'foo (ses-get-cell 0 0))
- (dolist (c '((0 0 1) (1 0 (1+ foo))))
+ (ses-rename-cell 'ses--foo (ses-get-cell 0 0))
+ (dolist (c '((0 0 1) (1 0 (1+ ses--foo))))
(apply 'funcall-interactively 'ses-edit-cell c))
(ses-command-hook)
(should-not (local-variable-p 'A1))
- (should (eq foo 1))
- (should (equal (ses-cell-formula 1 0) '(1+ foo)))
- (should (eq A2 2)))))
+ (should (eq ses--foo 1))
+ (should (equal (ses-cell-formula 1 0) '(1+ ses--foo)))
+ (should (eq (bound-and-true-p A2) 2)))))
(ert-deftest ses-tests-renamed-cell-after-setting ()
"Check that setting A1 to 1 and A2 to (1+ A1), and then
-renaming A1 to `foo' makes `foo' value equal to 2."
+renaming A1 to `ses--foo' makes `ses--foo' value equal to 2."
(let ((ses-initial-size '(2 . 1)))
(with-temp-buffer
(ses-mode)
(dolist (c '((0 0 1) (1 0 (1+ A1))))
(apply 'funcall-interactively 'ses-edit-cell c))
(ses-command-hook); deferred recalc
- (ses-rename-cell 'foo (ses-get-cell 0 0))
+ (ses-rename-cell 'ses--foo (ses-get-cell 0 0))
(should-not (local-variable-p 'A1))
- (should (eq foo 1))
- (should (equal (ses-cell-formula 1 0) '(1+ foo)))
- (should (eq A2 2)))))
+ (should (eq ses--foo 1))
+ (should (equal (ses-cell-formula 1 0) '(1+ ses--foo)))
+ (should (eq (bound-and-true-p A2) 2)))))
(ert-deftest ses-tests-renaming-cell-with-one-symbol-formula ()
"Check that setting A1 to 1 and A2 to A1, and then renaming A1
-to `foo' makes `foo' value equal to 1. Then set A1 to 2 and check
-that `foo' becomes 2."
+to `ses--foo' makes `ses--foo' value equal to 1. Then set A1 to 2 and check
+that `ses--foo' becomes 2."
(let ((ses-initial-size '(3 . 1)))
(with-temp-buffer
(ses-mode)
(dolist (c '((0 0 1) (1 0 A1)))
(apply 'funcall-interactively 'ses-edit-cell c))
(ses-command-hook); deferred recalc
- (ses-rename-cell 'foo (ses-get-cell 0 0))
+ (ses-rename-cell 'ses--foo (ses-get-cell 0 0))
(ses-command-hook); deferred recalc
(should-not (local-variable-p 'A1))
- (should (eq foo 1))
- (should (equal (ses-cell-formula 1 0) 'foo))
- (should (eq A2 1))
+ (should (eq ses--foo 1))
+ (should (equal (ses-cell-formula 1 0) 'ses--foo))
+ (should (eq (bound-and-true-p A2) 1))
(funcall-interactively 'ses-edit-cell 0 0 2)
(ses-command-hook); deferred recalc
- (should (eq A2 2))
- (should (eq foo 2)))))
+ (should (eq (bound-and-true-p A2) 2))
+ (should (eq ses--foo 2)))))
;; ROW INSERTION TESTS
@@ -144,12 +147,14 @@ to A2 and inserting a row, makes A2 value empty, and A3
equal to
(ses-jump 'A2)
(ses-insert-row 1)
(ses-command-hook)
- (should-not A2)
- (should (eq A3 2)))))
+ (should-not (bound-and-true-p A2))
+ (should (eq (bound-and-true-p A3) 2)))))
+
+(defvar ses--bar)
(ert-deftest ses-tests-renamed-cells-row-insertion ()
- "Check that setting A1 to 1 and A2 to (1+ A1), and then renaming A1 to `foo'
and A2 to `bar' jumping
-to `bar' and inserting a row, makes A2 value empty, and `bar' equal to
+ "Check that setting A1 to 1 and A2 to (1+ A1), and then renaming A1 to
`ses--foo' and A2 to `ses--bar' jumping
+to `ses--bar' and inserting a row, makes A2 value empty, and `ses--bar' equal
to
2."
(let ((ses-initial-size '(2 . 1)))
(with-temp-buffer
@@ -157,16 +162,16 @@ to `bar' and inserting a row, makes A2 value empty, and
`bar' equal to
(dolist (c '((0 0 1) (1 0 (1+ A1))))
(apply 'funcall-interactively 'ses-edit-cell c))
(ses-command-hook)
- (ses-rename-cell 'foo (ses-get-cell 0 0))
+ (ses-rename-cell 'ses--foo (ses-get-cell 0 0))
(ses-command-hook)
- (ses-rename-cell 'bar (ses-get-cell 1 0))
+ (ses-rename-cell 'ses--bar (ses-get-cell 1 0))
(ses-command-hook)
- (should (eq bar 2))
- (ses-jump 'bar)
+ (should (eq ses--bar 2))
+ (ses-jump 'ses--bar)
(ses-insert-row 1)
(ses-command-hook)
- (should-not A2)
- (should (eq bar 2)))))
+ (should-not (bound-and-true-p A2))
+ (should (eq ses--bar 2)))))
(provide 'ses-tests)
- [Emacs-diffs] feature/gnus-select 2544299 076/218: Try to stop tramp test hangs on hydra, (continued)
- [Emacs-diffs] feature/gnus-select 2544299 076/218: Try to stop tramp test hangs on hydra, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 520498d 091/218: Improve port to NetBSD tzalloc, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 02b297b 044/218: ; Revert "; Tracing for eieio-test random failure (Bug#24503)", Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a381e7e 002/218: Define if-let* and derivatives as aliases for if-let etc, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a8e5163 070/218: Minor changes in mule.texi, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 03e7331 089/218: * lisp/pcomplete.el (pcomplete-here): Move before first reference., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 040f725 093/218: * lisp/emulation/cua-base.el (cua-paste): Quieten compilation., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select f5219ae 094/218: Replace some obsolete uses of filter-buffer-substring-functions, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 25950c1 095/218: Suppress warnings about obsolete generics (bug#25556), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 965f4ec 100/218: * lisp/gnus/gnus-registry.el: Add missing compile-time requirement., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e2aebb9 090/218: * test/lisp/ses-tests.el: Quieten compilation.,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select c52e2e2 099/218: Fix 'posn-at-point' when line numbers are displayed, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e907e4a 102/218: Improve word motion docs (Bug#30815), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 08b32c9 105/218: Print test timings unconditionally, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 58da563 110/218: * lisp/url/url-handlers.el: Require subr-x., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 513b7fc 111/218: Fix compilation warnings in subr-x-tests.el, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select aceb821 047/218: Remove many items obsolete since Emacs 22.1, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select ec18ff5 118/218: Followup to last change in browse-url.el, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 10794c8 119/218: Print top time consuming tests if advised, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 1ac0958 123/218: Fix recently-added POP doc glitch, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 0f8f94d 121/218: Fix frame resize flicker on macOS (bug#30699), Andrew G Cohen, 2018/12/14