From 07e6189b4e1e6b10f3f472fdd280600f02ea65d1 Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Fri, 16 Sep 2022 21:55:35 -0500 Subject: [PATCH] Added to vimsplit test suite --- core/test/vimsplit.bats | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/core/test/vimsplit.bats b/core/test/vimsplit.bats index 200398c..e318228 100644 --- a/core/test/vimsplit.bats +++ b/core/test/vimsplit.bats @@ -8,6 +8,20 @@ bats_require_minimum_version 1.5.0 [ "$stderr" = "" ] } +@test "vimsplit version - quiet" { + run --separate-stderr vimsplit --version --quiet + [ "$status" -eq 0 ] + [ "$output" = "vimsplit 1.0" ] + [ "$stderr" = "" ] +} + +@test "vimsplit version - quiet short" { + run --separate-stderr vimsplit --version -q + [ "$status" -eq 0 ] + [ "$output" = "vimsplit 1.0" ] + [ "$stderr" = "" ] +} + @test "vimsplit version short" { run --separate-stderr vimsplit -v [ "$status" -eq 0 ] @@ -15,6 +29,20 @@ bats_require_minimum_version 1.5.0 [ "$stderr" = "" ] } +@test "vimsplit version short - quiet" { + run --separate-stderr vimsplit -v --quiet + [ "$status" -eq 0 ] + [ "$output" = "vimsplit 1.0" ] + [ "$stderr" = "" ] +} + +@test "vimsplit version short - quiet short" { + run --separate-stderr vimsplit -v -q + [ "$status" -eq 0 ] + [ "$output" = "vimsplit 1.0" ] + [ "$stderr" = "" ] +} + @test "vimsplit help" { run --separate-stderr vimsplit --help [ "$status" -eq 0 ] @@ -26,6 +54,28 @@ bats_require_minimum_version 1.5.0 [ "$stderr" = "" ] } +@test "vimsplit help - quiet" { + run --separate-stderr vimsplit --help --quiet + [ "$status" -eq 0 ] + [ "${lines[0]}" = "Open two files in split windows" ] + [ "${lines[1]}" = "Usage: vimsplit FILE1 FILE2" ] + [ "${lines[2]}" = "Options:" ] + [ "${lines[3]}" = " -h, --help print this message and exit" ] + [ "${lines[4]}" = " -v, --version print version number and exit" ] + [ "$stderr" = "" ] +} + +@test "vimsplit help - quiet short" { + run --separate-stderr vimsplit --help -q + [ "$status" -eq 0 ] + [ "${lines[0]}" = "Open two files in split windows" ] + [ "${lines[1]}" = "Usage: vimsplit FILE1 FILE2" ] + [ "${lines[2]}" = "Options:" ] + [ "${lines[3]}" = " -h, --help print this message and exit" ] + [ "${lines[4]}" = " -v, --version print version number and exit" ] + [ "$stderr" = "" ] +} + @test "vimsplit help short" { run --separate-stderr vimsplit -h [ "$status" -eq 0 ] @@ -37,6 +87,28 @@ bats_require_minimum_version 1.5.0 [ "$stderr" = "" ] } +@test "vimsplit help short - quiet" { + run --separate-stderr vimsplit -h --quiet + [ "$status" -eq 0 ] + [ "${lines[0]}" = "Open two files in split windows" ] + [ "${lines[1]}" = "Usage: vimsplit FILE1 FILE2" ] + [ "${lines[2]}" = "Options:" ] + [ "${lines[3]}" = " -h, --help print this message and exit" ] + [ "${lines[4]}" = " -v, --version print version number and exit" ] + [ "$stderr" = "" ] +} + +@test "vimsplit help short - quiet short" { + run --separate-stderr vimsplit -h -q + [ "$status" -eq 0 ] + [ "${lines[0]}" = "Open two files in split windows" ] + [ "${lines[1]}" = "Usage: vimsplit FILE1 FILE2" ] + [ "${lines[2]}" = "Options:" ] + [ "${lines[3]}" = " -h, --help print this message and exit" ] + [ "${lines[4]}" = " -v, --version print version number and exit" ] + [ "$stderr" = "" ] +} + @test "vimsplit 1 file" { run --separate-stderr vimsplit foobarbaz [ "$status" -eq 1 ] -- 2.45.2