|
19 | 19 | import static org.junit.jupiter.api.Assertions.assertEquals; |
20 | 20 | import static org.junit.jupiter.api.Assertions.assertThrows; |
21 | 21 | import static org.junit.jupiter.api.Assertions.assertTrue; |
22 | | -import static org.junit.jupiter.api.Assertions.fail; |
23 | 22 |
|
24 | 23 | import org.junit.jupiter.api.Test; |
25 | 24 | import org.junit.jupiter.api.parallel.Execution; |
@@ -182,15 +181,7 @@ void testIDiv() |
182 | 181 | Type4Tester.create("3 2 idiv").pop(1).isEmpty(); |
183 | 182 | Type4Tester.create("4 2 idiv").pop(2).isEmpty(); |
184 | 183 | Type4Tester.create("-5 2 idiv").pop(-2).isEmpty(); |
185 | | - try |
186 | | - { |
187 | | - Type4Tester.create("4.4 2 idiv"); |
188 | | - fail("Expected typecheck"); |
189 | | - } |
190 | | - catch (ClassCastException cce) |
191 | | - { |
192 | | - //expected |
193 | | - } |
| 184 | + assertThrows(ClassCastException.class, () -> Type4Tester.create("4.4 2 idiv"), "Expected typecheck"); |
194 | 185 | } |
195 | 186 |
|
196 | 187 | /** |
@@ -224,15 +215,7 @@ void testMod() |
224 | 215 | Type4Tester.create("5 3 mod").pop(2).isEmpty(); |
225 | 216 | Type4Tester.create("5 2 mod").pop(1).isEmpty(); |
226 | 217 | Type4Tester.create("-5 3 mod").pop(-2).isEmpty(); |
227 | | - try |
228 | | - { |
229 | | - Type4Tester.create("4.4 2 mod"); |
230 | | - fail("Expected typecheck"); |
231 | | - } |
232 | | - catch (ClassCastException cce) |
233 | | - { |
234 | | - //expected |
235 | | - } |
| 218 | + assertThrows(ClassCastException.class, () -> Type4Tester.create("4.4 2 mod"), "Expected typecheck"); |
236 | 219 | } |
237 | 220 |
|
238 | 221 | /** |
|
0 commit comments