Skip to content

Commit

Permalink
Sync armstrong-number tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras committed Apr 22, 2024
1 parent 9293864 commit 40a7b22
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions exercises/practice/armstrong-numbers/armstrong-numbers-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,58 @@
(load-file "armstrong-numbers.el")
(declare-function armstrong-p "armstrong-numbers.el" (n))

(ert-deftest armstrong-number-0 ()
"Zero is an Armstrong number"
(should (armstrong-p 0)))

(ert-deftest armstrong-number-5 ()
"Single digit numbers are Armstrong numbers"
"Single-digit numbers are Armstrong numbers"
(should (armstrong-p 5)))


(ert-deftest not-armstrong-number-10 ()
"There are no 2 digit Armstrong numbers"
(should (not (armstrong-p 10))))
"There are no two-digit Armstrong numbers"
(should-not (armstrong-p 10)))


(ert-deftest armstrong-number-153 ()
"Three digit number that should an Armstrong number"
"Three-digit number that is an Armstrong number"
(should (armstrong-p 153)))


(ert-deftest not-armstrong-number-100 ()
"Three digit number that should an Armstrong number"
(should (not (armstrong-p 100))))
"Three-digit number that is not an Armstrong number"
(should-not (armstrong-p 100)))


(ert-deftest armstrong-number-9474 ()
"Four digit number that should an Armstrong number"
"Four-digit number that is an Armstrong number"
(should (armstrong-p 9474)))


(ert-deftest not-armstrong-number-9475 ()
"Four digit number that should not an Armstrong number"
(should (not (armstrong-p 9476))))
"Four-digit number that is not an Armstrong number"
(should-not (armstrong-p 9476)))


(ert-deftest armstrong-number-9926315 ()
"Seven digit number that should an Armstrong number"
"Seven-digit number that is an Armstrong number"
(should (armstrong-p 9926315)))


(ert-deftest not-armstrong-number-9926314 ()
"Seven digit number that should not an Armstrong number"
(should (not (armstrong-p 9926314))))
"Seven-digit number that is not an Armstrong number"
(should-not (armstrong-p 9926314)))


(ert-deftest armstrong-number-186709961001538790100634132976990 ()
"Armstrong number containing seven zeroes that should be an Armstrong number"
(should (armstrong-p 186709961001538790100634132976990)))


(ert-deftest armstrong-number-115132219018763992565095597973971522401 ()
"The largest and last Armstrong number should be an Armstrong number"
(should (armstrong-p 115132219018763992565095597973971522401)))

(provide 'armstrong-numbers-test)
;;; armstrong-numbers-test.el ends here

0 comments on commit 40a7b22

Please sign in to comment.