aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/justify.bats14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/justify.bats b/tests/justify.bats
index 73db029..806ea81 100644
--- a/tests/justify.bats
+++ b/tests/justify.bats
@@ -57,7 +57,7 @@ EOF
assert_output "Hello world"
}
-@test "word longer than buffer is wrapped" {
+@test "word longer than buffer is wrapped to next line" {
run "${JUSTIFY_BIN}" -w 60 <<EOF
123456789012345678901234567890123456789012345678901234567890EXTRA
EOF
@@ -67,6 +67,18 @@ EXTRA"
assert_output "$expected_output"
}
+@test "word longer than buffer is wrapped across multiple lines" {
+ run "${JUSTIFY_BIN}" -w 20 <<EOF
+verylongwordthatdoesnotfitinasinglelineandshouldbesplitacrossmultiplelines
+EOF
+ assert_success
+ expected_output="verylongwordthatdoes
+notfitinasinglelinea
+ndshouldbesplitacros
+smultiplelines"
+ assert_output "$expected_output"
+}
+
@test "multiple spaces in input are collapsed when on last left-aligned line" {
run "${JUSTIFY_BIN}" <<EOF
This is spaced