diff options
author | Norbert Preining <norbert@preining.info> | 2020-03-05 03:00:59 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-03-05 03:00:59 +0000 |
commit | 898048513951b471a492afa23e46112d14bcb236 (patch) | |
tree | 8596afc705f55d2d07b324a756f7283ac0e2d21b /support/arara/source/src/test/kotlin/org/islandoftex/arara/utils/ExtensionTest.kt | |
parent | 19d25b8009801aa98ea2f46b45c37c257f990491 (diff) |
CTAN sync 202003050300
Diffstat (limited to 'support/arara/source/src/test/kotlin/org/islandoftex/arara/utils/ExtensionTest.kt')
-rw-r--r-- | support/arara/source/src/test/kotlin/org/islandoftex/arara/utils/ExtensionTest.kt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/support/arara/source/src/test/kotlin/org/islandoftex/arara/utils/ExtensionTest.kt b/support/arara/source/src/test/kotlin/org/islandoftex/arara/utils/ExtensionTest.kt new file mode 100644 index 0000000000..cd41545ee9 --- /dev/null +++ b/support/arara/source/src/test/kotlin/org/islandoftex/arara/utils/ExtensionTest.kt @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: BSD-3-Clause +package org.islandoftex.arara.utils + +import io.kotlintest.shouldBe +import io.kotlintest.shouldThrow +import io.kotlintest.specs.ShouldSpec + +class ExtensionTest : ShouldSpec({ + should("abbreviate strings correctly") { + "Quack quack".abbreviate(6) shouldBe "Quack…" + "Quack Quack".abbreviate(80) shouldBe "Quack Quack" + shouldThrow<IllegalArgumentException> { "Quack".abbreviate(1) } + } + + should("center strings correctly") { + "Quack".center(3, '-') shouldBe "Quack" + "Quack".center(9, '-') shouldBe "--Quack--" + } + + should("wrap strings correctly") { + "This text should be wrapped".wrap(10) shouldBe "This text\nshould be\nwrapped" + } +}) |