Skip to content

Commit 32c274c

Browse files
authored
Sync armstrong-number tests (#353)
* Sync armstrong-number tests * Update stub formatting
1 parent 2c79d07 commit 32c274c

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

exercises/practice/armstrong-numbers/armstrong-numbers-test.el

+26-12
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,58 @@
77
(load-file "armstrong-numbers.el")
88
(declare-function armstrong-p "armstrong-numbers.el" (n))
99

10+
(ert-deftest armstrong-number-0 ()
11+
"Zero is an Armstrong number"
12+
(should (armstrong-p 0)))
13+
1014
(ert-deftest armstrong-number-5 ()
11-
"Single digit numbers are Armstrong numbers"
15+
"Single-digit numbers are Armstrong numbers"
1216
(should (armstrong-p 5)))
1317

18+
1419
(ert-deftest not-armstrong-number-10 ()
15-
"There are no 2 digit Armstrong numbers"
16-
(should (not (armstrong-p 10))))
20+
"There are no two-digit Armstrong numbers"
21+
(should-not (armstrong-p 10)))
22+
1723

1824
(ert-deftest armstrong-number-153 ()
19-
"Three digit number that should an Armstrong number"
25+
"Three-digit number that is an Armstrong number"
2026
(should (armstrong-p 153)))
2127

28+
2229
(ert-deftest not-armstrong-number-100 ()
23-
"Three digit number that should an Armstrong number"
24-
(should (not (armstrong-p 100))))
30+
"Three-digit number that is not an Armstrong number"
31+
(should-not (armstrong-p 100)))
32+
2533

2634
(ert-deftest armstrong-number-9474 ()
27-
"Four digit number that should an Armstrong number"
35+
"Four-digit number that is an Armstrong number"
2836
(should (armstrong-p 9474)))
2937

38+
3039
(ert-deftest not-armstrong-number-9475 ()
31-
"Four digit number that should not an Armstrong number"
32-
(should (not (armstrong-p 9476))))
40+
"Four-digit number that is not an Armstrong number"
41+
(should-not (armstrong-p 9476)))
42+
3343

3444
(ert-deftest armstrong-number-9926315 ()
35-
"Seven digit number that should an Armstrong number"
45+
"Seven-digit number that is an Armstrong number"
3646
(should (armstrong-p 9926315)))
3747

48+
3849
(ert-deftest not-armstrong-number-9926314 ()
39-
"Seven digit number that should not an Armstrong number"
40-
(should (not (armstrong-p 9926314))))
50+
"Seven-digit number that is not an Armstrong number"
51+
(should-not (armstrong-p 9926314)))
52+
4153

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

58+
4659
(ert-deftest armstrong-number-115132219018763992565095597973971522401 ()
4760
"The largest and last Armstrong number should be an Armstrong number"
4861
(should (armstrong-p 115132219018763992565095597973971522401)))
4962

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

exercises/practice/armstrong-numbers/armstrong-numbers.el

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
;;; Commentary:
44

5-
(defun armstrong-p (n)
65
;;; Code:
7-
)
6+
7+
8+
(defun armstrong-p (n)
9+
(error "Delete this S-Expression and write your own implementation"))
10+
811

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

0 commit comments

Comments
 (0)