1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-05-31 23:50:49 +00:00
plantuml/test/net/sourceforge/plantuml/StringUtilsTest.java
2022-12-17 12:10:05 +01:00

30 lines
686 B
Java

package net.sourceforge.plantuml;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
class StringUtilsTest {
@ParameterizedTest
@CsvSource(nullValues = "null", value = {
" null , true ",
" '' , true ",
" ' ' , true ",
" '\0' , true ",
" '\n' , true ",
" '\r' , true ",
" '\t' , true ",
" 'x' , false ",
" ' x ' , false ",
})
void test_isEmpty_isNotEmpty(String s, boolean empty) {
assertThat(StringUtils.isEmpty(s))
.isEqualTo(empty);
assertThat(StringUtils.isNotEmpty(s))
.isNotEqualTo(empty);
}
}