|
13 | 13 | (should (= 5 (answer "What is 5?")))) |
14 | 14 |
|
15 | 15 |
|
| 16 | +(ert-deftest just-a-zero () |
| 17 | + (should (= 0 (answer "What is 0?")))) |
| 18 | + |
| 19 | + |
| 20 | +(ert-deftest just-a-negative-number () |
| 21 | + (should (= -123 (answer "What is -123?")))) |
| 22 | + |
| 23 | + |
16 | 24 | (ert-deftest addition () |
17 | 25 | (should (= 2 (answer "What is 1 plus 1?")))) |
18 | 26 |
|
19 | 27 |
|
| 28 | +(ert-deftest addition-with-a-left-hand-zero () |
| 29 | + (should (= 2 (answer "What is 0 plus 2?")))) |
| 30 | + |
| 31 | + |
| 32 | +(ert-deftest addition-with-a-right-hand-zero () |
| 33 | + (should (= 3 (answer "What is 3 plus 0?")))) |
| 34 | + |
| 35 | + |
20 | 36 | (ert-deftest more-addition () |
21 | 37 | (should (= 55 (answer "What is 53 plus 2?")))) |
22 | 38 |
|
|
70 | 86 |
|
71 | 87 |
|
72 | 88 | (ert-deftest unknown-operation () |
73 | | - (should-error (answer "What is 52 cubed?"))) |
| 89 | + (should-error (answer "What is 52 cubed?") :type 'parse-error)) |
74 | 90 |
|
75 | 91 |
|
76 | 92 | (ert-deftest non-math-question () |
77 | | - (should-error (answer "Who is the President of the United States?"))) |
| 93 | + (should-error (answer "Who is the President of the United States?") :type 'parse-error)) |
78 | 94 |
|
79 | 95 |
|
80 | 96 | (ert-deftest reject-problem-missing-an-operand () |
81 | | - (should-error (answer "What is 1 plus?"))) |
| 97 | + (should-error (answer "What is 1 plus?") :type 'parse-error)) |
82 | 98 |
|
83 | 99 |
|
84 | 100 | (ert-deftest reject-problem-with-no-operands-or-operators () |
85 | | - (should-error (answer "What is?"))) |
| 101 | + (should-error (answer "What is?") :type 'parse-error)) |
86 | 102 |
|
87 | 103 |
|
88 | 104 | (ert-deftest reject-two-operations-in-a-row () |
89 | | - (should-error (answer "What is 1 plus plus 2?"))) |
| 105 | + (should-error (answer "What is 1 plus plus 2?") :type 'parse-error)) |
90 | 106 |
|
91 | 107 |
|
92 | 108 | (ert-deftest reject-two-numbers-in-a-row () |
93 | | - (should-error (answer "What is 1 plus 2 1?"))) |
| 109 | + (should-error (answer "What is 1 plus 2 1?") :type 'parse-error)) |
94 | 110 |
|
95 | 111 |
|
96 | 112 | (ert-deftest reject-postfix-notation () |
97 | | - (should-error (answer "What is 1 2 plus?"))) |
| 113 | + (should-error (answer "What is 1 2 plus?") :type 'parse-error)) |
98 | 114 |
|
99 | 115 |
|
100 | 116 | (ert-deftest reject-prefix-notation () |
101 | | - (should-error (answer "What is plus 1 2?"))) |
| 117 | + (should-error (answer "What is plus 1 2?") :type 'parse-error)) |
102 | 118 |
|
103 | 119 |
|
104 | 120 | (provide 'wordy-test) |
|
0 commit comments