diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2024-07-15 23:52:28 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2024-07-16 00:25:07 +0200 |
| commit | 42564c71cfb70c28831c662a3b6bf4084e079353 (patch) | |
| tree | 111456fd3e8dce884d0380a81d70950062c7d212 /app/src/test/java/org/the_jk/cleversync/StringUtilsTest.kt | |
| parent | 4a8f6807c9d3ee6bcfac25aee832163036b4e6fe (diff) | |
Break out io code in libs
Preparing for adding more io implementations.
Really tried writing the convention plugins in kotlin dsl but could
not find the exact right hacks to get it to work.
Diffstat (limited to 'app/src/test/java/org/the_jk/cleversync/StringUtilsTest.kt')
| -rw-r--r-- | app/src/test/java/org/the_jk/cleversync/StringUtilsTest.kt | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/app/src/test/java/org/the_jk/cleversync/StringUtilsTest.kt b/app/src/test/java/org/the_jk/cleversync/StringUtilsTest.kt deleted file mode 100644 index 6a36156..0000000 --- a/app/src/test/java/org/the_jk/cleversync/StringUtilsTest.kt +++ /dev/null @@ -1,40 +0,0 @@ -package org.the_jk.cleversync - -import com.google.common.truth.Truth.assertThat -import org.junit.Test - -class StringUtilsTest { - @Test - fun splitEmpty() { - assertThat(StringUtils.split("", '.', keepEmpty = true)).containsExactly("") - assertThat(StringUtils.split("", '.', keepEmpty = false)).isEmpty() - } - - @Test - fun splitSanity() { - assertThat(StringUtils.split("a.bb.a", '.')).containsExactly("a", "bb", "a").inOrder() - assertThat(StringUtils.split(".a.bb.a", '.', keepEmpty = true)).containsExactly("", "a", "bb", "a").inOrder() - assertThat(StringUtils.split(".a.bb.a", '.', keepEmpty = false)).containsExactly("a", "bb", "a").inOrder() - assertThat(StringUtils.split(".a.bb.a.", '.', keepEmpty = true)) - .containsExactly("", "a", "bb", "a", "").inOrder() - assertThat(StringUtils.split(".a.bb.a.", '.', keepEmpty = false)).containsExactly("a", "bb", "a").inOrder() - } - - @Test - fun splitDouble() { - assertThat(StringUtils.split("foo..bar", '.', keepEmpty = true)).containsExactly("foo", "", "bar").inOrder() - assertThat(StringUtils.split("foo..bar", '.', keepEmpty = false)).containsExactly("foo", "bar").inOrder() - } - - @Test - fun splitLimit() { - assertThat(StringUtils.split("a.bb.a", '.', limit = 1)).containsExactly("a.bb.a") - assertThat(StringUtils.split("a.bb.a", '.', limit = 2)).containsExactly("a", "bb.a").inOrder() - assertThat(StringUtils.split("a.bb.a", '.', limit = 3)).containsExactly("a", "bb", "a").inOrder() - assertThat(StringUtils.split("a.bb.a.", '.', limit = 3, keepEmpty = true)) - .containsExactly("a", "bb", "a.").inOrder() - assertThat(StringUtils.split("a.bb.a.", '.', limit = 3, keepEmpty = false)) - .containsExactly("a", "bb", "a").inOrder() - assertThat(StringUtils.split("a.bb.a", '.', limit = 1000)).containsExactly("a", "bb", "a").inOrder() - } -} |
