1 package net.pterodactylus.sone.utils
3 import org.hamcrest.MatcherAssert.assertThat
4 import org.hamcrest.Matchers.equalTo
5 import org.hamcrest.Matchers.nullValue
9 * Unit test for [StringsKt].
14 fun `non-empty string is returned as-is`() {
15 assertThat("non-empty".emptyToNull, equalTo("non-empty"))
19 fun `string with whitespace only is returned as null`() {
20 assertThat(" ".emptyToNull, nullValue())
24 fun `zero-length string is returned as null`() {
25 assertThat("".emptyToNull, nullValue())
29 fun `null is returned as null`() {
30 assertThat(null.emptyToNull, nullValue())