From c6d2070eba8027d9d113b15d45b5e55d8281292b Mon Sep 17 00:00:00 2001 From: FourteenBrush Date: Sun, 16 Jun 2024 21:37:52 +0200 Subject: [PATCH] Replace assertThatCode() with assertThatThrownBy() (we always expect to throw) --- .../mathexpressionparser/ExpressionParserTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/me/fourteendoggo/mathexpressionparser/ExpressionParserTest.java b/core/src/test/java/me/fourteendoggo/mathexpressionparser/ExpressionParserTest.java index 23d5243..cb46221 100644 --- a/core/src/test/java/me/fourteendoggo/mathexpressionparser/ExpressionParserTest.java +++ b/core/src/test/java/me/fourteendoggo/mathexpressionparser/ExpressionParserTest.java @@ -152,8 +152,8 @@ void testBooleanTruthTables() { assertThat(ExpressionParser.parse("~1")).isEqualTo(~1); assertThat(ExpressionParser.parse("~0")).isEqualTo(~0); - assertThatCode(() -> ExpressionParser.parse("~-1.5")).isInstanceOf(SyntaxException.class); - assertThatCode(() -> ExpressionParser.parse("~2.3")).isInstanceOf(SyntaxException.class); + assertThatThrownBy(() -> ExpressionParser.parse("~-1.5")).isInstanceOf(SyntaxException.class); + assertThatThrownBy(() -> ExpressionParser.parse("~2.3")).isInstanceOf(SyntaxException.class); assertThat(ExpressionParser.parse("~8")).isEqualTo(~8); assertThat(ExpressionParser.parse("~(2+~9)")).isEqualTo(~(2+~9));