@@ -48,6 +48,13 @@ public void testErrorIfAdditionAttemptedWithOneNumberOnTheStack() {
48
48
.withMessage ("Addition requires that the stack contain at least 2 values" );
49
49
}
50
50
51
+ @ Disabled ("Remove to run test" )
52
+ @ Test
53
+ public void testAdditionForMoreThanTwoValuesOnTheStack () {
54
+ assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("1 2 3 +" )))
55
+ .containsExactly (1 , 5 );
56
+ }
57
+
51
58
@ Disabled ("Remove to run test" )
52
59
@ Test
53
60
public void testTwoNumbersCanBeSubtracted () {
@@ -72,6 +79,13 @@ public void testErrorIfSubtractionAttemptedWithOneNumberOnTheStack() {
72
79
.withMessage ("Subtraction requires that the stack contain at least 2 values" );
73
80
}
74
81
82
+ @ Disabled ("Remove to run test" )
83
+ @ Test
84
+ public void testSubtractionForMoreThanTwoValuesOnTheStack () {
85
+ assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("1 12 3 -" )))
86
+ .containsExactly (1 , 9 );
87
+ }
88
+
75
89
@ Disabled ("Remove to run test" )
76
90
@ Test
77
91
public void testTwoNumbersCanBeMultiplied () {
@@ -94,6 +108,13 @@ public void testErrorIfMultiplicationAttemptedWithOneNumberOnTheStack() {
94
108
.withMessage ("Multiplication requires that the stack contain at least 2 values" );
95
109
}
96
110
111
+ @ Disabled ("Remove to run test" )
112
+ @ Test
113
+ public void testMultiplicationForMoreThanTwoValuesOnTheStack () {
114
+ assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("1 2 3 *" )))
115
+ .containsExactly (1 , 6 );
116
+ }
117
+
97
118
@ Disabled ("Remove to run test" )
98
119
@ Test
99
120
public void testTwoNumbersCanBeDivided () {
@@ -130,6 +151,13 @@ public void testErrorIfDivisionAttemptedWithOneNumberOnTheStack() {
130
151
.withMessage ("Division requires that the stack contain at least 2 values" );
131
152
}
132
153
154
+ @ Disabled ("Remove to run test" )
155
+ @ Test
156
+ public void testDivisionForMoreThanTwoValuesOnTheStack () {
157
+ assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("1 12 3 /" )))
158
+ .containsExactly (1 , 4 );
159
+ }
160
+
133
161
@ Disabled ("Remove to run test" )
134
162
@ Test
135
163
public void testCombinedAdditionAndSubtraction () {
@@ -142,6 +170,18 @@ public void testCombinedMultiplicationAndDivision() {
142
170
assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("2 4 * 3 /" ))).containsExactly (2 );
143
171
}
144
172
173
+ @ Disabled ("Remove to run test" )
174
+ @ Test
175
+ public void testCombinedMultiplicationAndAddition () {
176
+ assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("1 3 4 * +" ))).containsExactly (13 );
177
+ }
178
+
179
+ @ Disabled ("Remove to run test" )
180
+ @ Test
181
+ public void testCombinedAdditionAndMultiplication () {
182
+ assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("1 3 4 + *" ))).containsExactly (7 );
183
+ }
184
+
145
185
@ Disabled ("Remove to run test" )
146
186
@ Test
147
187
public void testDupCopiesAValueOnTheStack () {
0 commit comments