Skip to content

Commit

Permalink
Fix failing tests because ERT now fails when redefining tests
Browse files Browse the repository at this point in the history
> *** Redefining an ERT test in batch mode now signals an error.
> Executing 'ert-deftest' with the same name as an existing test causes
> the previous definition to be discarded, which was probably not
> intended when this occurs in batch mode.  To remedy the error, rename
> tests so that they all have unique names.

- https://github.com/emacs-mirror/emacs/blob/2c201bbba5c43328979bf139330684cacfa074f3/etc/NEWS.29#L933-L937
  • Loading branch information
fapdash committed Jun 15, 2024
1 parent 286e5ea commit 01b139a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions exercises/practice/triangle/triangle-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
(declare-function scalenep "triangle.el" (sides))


(ert-deftest all-sides-are-equal ()
(ert-deftest all-sides-are-equal-1 ()
(should (equilateralp '(2 2 2))))


(ert-deftest any-side-is-unequal ()
(should-not (equilateralp '(2 3 2))))


(ert-deftest no-sides-are-equal ()
(ert-deftest no-sides-are-equal-1 ()
(should-not (equilateralp '(5 4 6))))


(ert-deftest all-zero-sides-is-not-a-triangle ()
(should-not (equilateralp '(0 0 0))))


(ert-deftest sides-may-be-floats ()
(ert-deftest sides-may-be-floats-1 ()
(should (equilateralp '(0.5 0.5 0.5))))


Expand All @@ -46,7 +46,7 @@
(should (isoscelesp '(4 4 4))))


(ert-deftest no-sides-are-equal ()
(ert-deftest no-sides-are-equal-2 ()
(should-not (isoscelesp '(2 3 4))))


Expand All @@ -62,15 +62,15 @@
(should-not (isoscelesp '(3 1 1))))


(ert-deftest sides-may-be-floats ()
(ert-deftest sides-may-be-floats-2 ()
(should (isoscelesp '(0.5 0.4 0.5))))


(ert-deftest no-sides-are-equal ()
(ert-deftest no-sides-are-equal-3 ()
(should (scalenep '(5 4 6))))


(ert-deftest all-sides-are-equal ()
(ert-deftest all-sides-are-equal-2 ()
(should-not (scalenep '(4 4 4))))


Expand All @@ -90,7 +90,7 @@
(should-not (scalenep '(7 3 2))))


(ert-deftest sides-may-be-floats ()
(ert-deftest sides-may-be-floats-3 ()
(should (scalenep '(0.5 0.4 0.6))))

(provide 'triangle-test)
Expand Down

0 comments on commit 01b139a

Please sign in to comment.