|
7 | 7 | (load-file "armstrong-numbers.el")
|
8 | 8 | (declare-function armstrong-p "armstrong-numbers.el" (n))
|
9 | 9 |
|
| 10 | +(ert-deftest armstrong-number-0 () |
| 11 | + "Zero is an Armstrong number" |
| 12 | + (should (armstrong-p 0))) |
| 13 | + |
10 | 14 | (ert-deftest armstrong-number-5 ()
|
11 |
| - "Single digit numbers are Armstrong numbers" |
| 15 | + "Single-digit numbers are Armstrong numbers" |
12 | 16 | (should (armstrong-p 5)))
|
13 | 17 |
|
| 18 | + |
14 | 19 | (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 | + |
17 | 23 |
|
18 | 24 | (ert-deftest armstrong-number-153 ()
|
19 |
| - "Three digit number that should an Armstrong number" |
| 25 | + "Three-digit number that is an Armstrong number" |
20 | 26 | (should (armstrong-p 153)))
|
21 | 27 |
|
| 28 | + |
22 | 29 | (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 | + |
25 | 33 |
|
26 | 34 | (ert-deftest armstrong-number-9474 ()
|
27 |
| - "Four digit number that should an Armstrong number" |
| 35 | + "Four-digit number that is an Armstrong number" |
28 | 36 | (should (armstrong-p 9474)))
|
29 | 37 |
|
| 38 | + |
30 | 39 | (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 | + |
33 | 43 |
|
34 | 44 | (ert-deftest armstrong-number-9926315 ()
|
35 |
| - "Seven digit number that should an Armstrong number" |
| 45 | + "Seven-digit number that is an Armstrong number" |
36 | 46 | (should (armstrong-p 9926315)))
|
37 | 47 |
|
| 48 | + |
38 | 49 | (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 | + |
41 | 53 |
|
42 | 54 | (ert-deftest armstrong-number-186709961001538790100634132976990 ()
|
43 | 55 | "Armstrong number containing seven zeroes that should be an Armstrong number"
|
44 | 56 | (should (armstrong-p 186709961001538790100634132976990)))
|
45 | 57 |
|
| 58 | + |
46 | 59 | (ert-deftest armstrong-number-115132219018763992565095597973971522401 ()
|
47 | 60 | "The largest and last Armstrong number should be an Armstrong number"
|
48 | 61 | (should (armstrong-p 115132219018763992565095597973971522401)))
|
49 | 62 |
|
| 63 | +(provide 'armstrong-numbers-test) |
50 | 64 | ;;; armstrong-numbers-test.el ends here
|
0 commit comments