diff options
Diffstat (limited to 'tests/justify.bats')
| -rw-r--r-- | tests/justify.bats | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/justify.bats b/tests/justify.bats index 806ea81..525c5d8 100644 --- a/tests/justify.bats +++ b/tests/justify.bats @@ -94,3 +94,42 @@ EOF assert_success assert_output "" } + +@test "unicode text with accented characters is justified correctly" { + run "${JUSTIFY_BIN}" -w 30 <<EOF +café résumé naïve Zürich another word +EOF + assert_success + expected_output="café résumé naïve Zürich +another word" + assert_output "$expected_output" +} + +@test "unicode text with CJK characters is justified correctly" { + run "${JUSTIFY_BIN}" -w 20 <<EOF +Hello 世界 test this is a longer line +EOF + assert_success + expected_output="Hello 世界 test this +is a longer line" + assert_output "$expected_output" +} + +@test "mixed ASCII and unicode text wraps correctly" { + run "${JUSTIFY_BIN}" -w 25 <<EOF +This is café and résumé text that should wrap properly +EOF + assert_success + expected_output="This is café and résumé +text that should wrap +properly" + assert_output "$expected_output" +} + +@test "unicode text on last line is left-aligned" { + run "${JUSTIFY_BIN}" <<EOF +café résumé +EOF + assert_success + assert_output "café résumé" +} |