@@ -48,6 +48,13 @@ public void testErrorIfAdditionAttemptedWithOneNumberOnTheStack() {
4848 .withMessage ("Addition requires that the stack contain at least 2 values" );
4949 }
5050
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+
5158 @ Disabled ("Remove to run test" )
5259 @ Test
5360 public void testTwoNumbersCanBeSubtracted () {
@@ -72,6 +79,13 @@ public void testErrorIfSubtractionAttemptedWithOneNumberOnTheStack() {
7279 .withMessage ("Subtraction requires that the stack contain at least 2 values" );
7380 }
7481
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+
7589 @ Disabled ("Remove to run test" )
7690 @ Test
7791 public void testTwoNumbersCanBeMultiplied () {
@@ -94,6 +108,13 @@ public void testErrorIfMultiplicationAttemptedWithOneNumberOnTheStack() {
94108 .withMessage ("Multiplication requires that the stack contain at least 2 values" );
95109 }
96110
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+
97118 @ Disabled ("Remove to run test" )
98119 @ Test
99120 public void testTwoNumbersCanBeDivided () {
@@ -130,6 +151,13 @@ public void testErrorIfDivisionAttemptedWithOneNumberOnTheStack() {
130151 .withMessage ("Division requires that the stack contain at least 2 values" );
131152 }
132153
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+
133161 @ Disabled ("Remove to run test" )
134162 @ Test
135163 public void testCombinedAdditionAndSubtraction () {
@@ -142,6 +170,18 @@ public void testCombinedMultiplicationAndDivision() {
142170 assertThat (forthEvaluator .evaluateProgram (Collections .singletonList ("2 4 * 3 /" ))).containsExactly (2 );
143171 }
144172
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+
145185 @ Disabled ("Remove to run test" )
146186 @ Test
147187 public void testDupCopiesAValueOnTheStack () {
0 commit comments