diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2025-07-12 11:06:35 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2025-07-12 11:06:35 -0400 |
| commit | 7816b122ef8806e212e716d32a88a4eaab5476a5 (patch) | |
| tree | 043e99a2f80fb05749250f01bb1e5fbc77ebc54a /tests/justify.bats | |
| parent | Refactor main to delegate to a `justify` function (diff) | |
| download | cli-7816b122ef8806e212e716d32a88a4eaab5476a5.zip | |
Add handling for zero or negative values for -w
Diffstat (limited to 'tests/justify.bats')
| -rw-r--r-- | tests/justify.bats | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/justify.bats b/tests/justify.bats index 86ae4df..6b7a275 100644 --- a/tests/justify.bats +++ b/tests/justify.bats @@ -6,6 +6,13 @@ load 'vendor/bats-file/load' JUSTIFY_BIN="./build/justify" +@test "-w should reject invalid values" { + run "${JUSTIFY_BIN}" -w 0 + assert_failure + run "${JUSTIFY_BIN}" -w -1 + assert_failure +} + @test "last line of the output is left aligned" { run "${JUSTIFY_BIN}" <<EOF This is a test of the emergency broadcast system. |