From b73910af1e434303d19d98a1eedc2c8e3408e337 Mon Sep 17 00:00:00 2001 From: Natan Tavares Santana <64803935+Neitan2001@users.noreply.github.com> Date: Tue, 22 Mar 2022 15:20:19 -0300 Subject: [PATCH] StringUtilTest new test for method GetPart (#8594) * Add new test for method get part in StringUtil class * Update StringUtilTest.java Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> --- src/test/java/org/jabref/model/strings/StringUtilTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/jabref/model/strings/StringUtilTest.java b/src/test/java/org/jabref/model/strings/StringUtilTest.java index d68a832dc3a..a3b82de9eb6 100644 --- a/src/test/java/org/jabref/model/strings/StringUtilTest.java +++ b/src/test/java/org/jabref/model/strings/StringUtilTest.java @@ -148,7 +148,10 @@ void testStripBrackets() { @Test void testGetPart() { - // Should be added + assertEquals("{roupa}", StringUtil.getPart("O rato roeu a {roupa} do rei de roma", 13, false)); + assertEquals("", StringUtil.getPart("", 0, false)); + assertEquals("", StringUtil.getPart("Um passo por }dia}", 12, false)); + assertEquals("dia", StringUtil.getPart("Um passo por dia", 12, true)); } @Test