aboutsummaryrefslogtreecommitdiffstats
path: root/tests/justify.bats
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2025-07-12 12:02:55 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2025-07-12 12:02:55 -0400
commitfc5666c693df9f0ab7a835db680b5bfbe2dffe92 (patch)
tree56895bb6261f37aa0609015b0515bd0ed56db9a6 /tests/justify.bats
parentAdd explanation comment for strlcat (diff)
downloadcli-fc5666c693df9f0ab7a835db680b5bfbe2dffe92.zip
Fix word wrapping to next line when the word is longer than the buffer
Diffstat (limited to 'tests/justify.bats')
-rw-r--r--tests/justify.bats19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/justify.bats b/tests/justify.bats
index a581c94..73db029 100644
--- a/tests/justify.bats
+++ b/tests/justify.bats
@@ -57,16 +57,15 @@ EOF
assert_output "Hello world"
}
-# TODO: Handle this case properly
-# @test "word longer than buffer is wrapped" {
-# run "${JUSTIFY_BIN}" -w 60 <<EOF
-# 123456789012345678901234567890123456789012345678901234567890EXTRA
-# EOF
-# assert_success
-# expected_output="123456789012345678901234567890123456789012345678901234567890
-# EXTRA"
-# assert_output "$expected_output"
-# }
+@test "word longer than buffer is wrapped" {
+ run "${JUSTIFY_BIN}" -w 60 <<EOF
+123456789012345678901234567890123456789012345678901234567890EXTRA
+EOF
+ assert_success
+ expected_output="123456789012345678901234567890123456789012345678901234567890
+EXTRA"
+ assert_output "$expected_output"
+}
@test "multiple spaces in input are collapsed when on last left-aligned line" {
run "${JUSTIFY_BIN}" <<EOF