From 53a95f867318fbb0b66a0829c05230ec7597294b Mon Sep 17 00:00:00 2001 From: The-Lum <86879521+The-Lum@users.noreply.github.com> Date: Wed, 13 Mar 2024 17:11:48 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20fix=20warning=20(from=20pmd)=20o?= =?UTF-8?q?n=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/test/java/math/ATest.java | 6 ++++-- app/src/test/java/math/MathTest.java | 2 +- app/src/test/java/math/UnitTestGen.java | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/test/java/math/ATest.java b/app/src/test/java/math/ATest.java index 283ba47..20f5d49 100644 --- a/app/src/test/java/math/ATest.java +++ b/app/src/test/java/math/ATest.java @@ -1,5 +1,7 @@ package math; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -10,9 +12,9 @@ class ATest { @CsvSource(value = { " a ", }) - public void atest(String input) { + void atest(String input) { final String res = cut.getTeX(input); System.out.println(input + " -> " + res); - assert(true); + assertNotNull(res, "Result must be not null"); } } \ No newline at end of file diff --git a/app/src/test/java/math/MathTest.java b/app/src/test/java/math/MathTest.java index b2efb21..476ecc3 100644 --- a/app/src/test/java/math/MathTest.java +++ b/app/src/test/java/math/MathTest.java @@ -21,7 +21,7 @@ class MathTest { " f_g, {{f}_{{g}}} ", " '[[1,2,3],[4,5,6]]', {\\left[\\begin{matrix}{1}&{2}&{3}\\\\{4}&{5}&{6}\\end{matrix}\\right]} ", }) - public void testMath(String input, String expected) { + void testMath(String input, String expected) { final String res = new ASCIIMathTeXImg().getTeX(input); assertEquals(expected, res); } diff --git a/app/src/test/java/math/UnitTestGen.java b/app/src/test/java/math/UnitTestGen.java index 31c2fd4..140434d 100644 --- a/app/src/test/java/math/UnitTestGen.java +++ b/app/src/test/java/math/UnitTestGen.java @@ -1,5 +1,7 @@ package math; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; @@ -505,11 +507,11 @@ static void initAll() { "/4", "lim_(x rarr 2^-) f(x)", }) - public void test(String input) { + void test(String input) { final String res = cut.getTeX(input); String out = "\t\t\"'" + input + "',\t'" + res + "'\","; System.out.println(out.replace("\\","\\\\")); - assert(true); + assertNotNull(res, "Result must be not null"); } @AfterAll