diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2025-07-12 12:10:23 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2025-07-12 12:13:08 -0400 |
| commit | 870904f2c3d7830aea32c3b735b42220155ff213 (patch) | |
| tree | d986b2b9d252adb84eb0b542a36f6737a05eb09a | |
| parent | Fix word wrapping to next line when the word is longer than the buffer (diff) | |
| download | cli-870904f2c3d7830aea32c3b735b42220155ff213.zip | |
Add additional test spanning multiple lines
| -rw-r--r-- | tests/justify.bats | 14 |
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 |