summaryrefslogtreecommitdiff
path: root/exercism/emacs-lisp/armstrong-numbers/armstrong-numbers-test.el
blob: 4851dbfaf0fa714af2d7f1064373a1a1a9432189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
;;; armstrong-numbers-test.el --- Tests for armstrong-numbers (exercism)

;;; Commentary:

;;; Code:

(load-file "armstrong-numbers.el")

(ert-deftest armstrong-number-5 ()
  "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))))

(ert-deftest armstrong-number-153 ()
  "Three digit number that should 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))))

(ert-deftest armstrong-number-9474 ()
  "Four digit number that should 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))))

(ert-deftest armstrong-number-9926315 ()
  "Seven digit number that should 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))))

;;; armstrong-numbers-test.el ends here