diff options
author | Zoltan Tombol <zoltan.tombol@gmail.com> | 2016-02-26 21:23:20 +0300 |
---|---|---|
committer | Zoltan Tombol <zoltan.tombol@gmail.com> | 2016-02-26 21:23:20 +0300 |
commit | bd7ece6cb495ba2f4cb7360226c6ba4966c1b7f6 (patch) | |
tree | 01692a66e9f6f935953da4a634fe8a423ca59d42 /test | |
parent | c529cbe996cc01d19d000048ff691014d150f7c2 (diff) |
Fix -- handling in output and line matching functions
Diffstat (limited to 'test')
-rwxr-xr-x | test/50-assert-15-assert_output.bats | 7 | ||||
-rwxr-xr-x | test/50-assert-16-refute_output.bats | 7 | ||||
-rwxr-xr-x | test/50-assert-17-assert_line.bats | 7 | ||||
-rwxr-xr-x | test/50-assert-18-refute_line.bats | 7 |
4 files changed, 28 insertions, 0 deletions
diff --git a/test/50-assert-15-assert_output.bats b/test/50-assert-15-assert_output.bats index de622f5..cca79cc 100755 --- a/test/50-assert-15-assert_output.bats +++ b/test/50-assert-15-assert_output.bats @@ -233,3 +233,10 @@ test_r_regexp () { [ "${lines[1]}" == "\`--partial' and \`--regexp' are mutually exclusive" ] [ "${lines[2]}" == '--' ] } + +@test "assert_output(): \`--' stops parsing options" { + run echo '-p' + run assert_output -- '-p' + [ "$status" -eq 0 ] + [ "${#lines[@]}" -eq 0 ] +} diff --git a/test/50-assert-16-refute_output.bats b/test/50-assert-16-refute_output.bats index 2d47155..5204301 100755 --- a/test/50-assert-16-refute_output.bats +++ b/test/50-assert-16-refute_output.bats @@ -187,3 +187,10 @@ test_r_regexp () { [ "${lines[1]}" == "\`--partial' and \`--regexp' are mutually exclusive" ] [ "${lines[2]}" == '--' ] } + +@test "refute_output(): \`--' stops parsing options" { + run echo '--' + run refute_output -- '-p' + [ "$status" -eq 0 ] + [ "${#lines[@]}" -eq 0 ] +} diff --git a/test/50-assert-17-assert_line.bats b/test/50-assert-17-assert_line.bats index cd4588e..bee3850 100755 --- a/test/50-assert-17-assert_line.bats +++ b/test/50-assert-17-assert_line.bats @@ -325,3 +325,10 @@ test_index_r_regexp () { [ "${lines[1]}" == "Invalid extended regular expression: \`[.*'" ] [ "${lines[2]}" == '--' ] } + +@test "assert_line(): \`--' stops parsing options" { + run printf 'a\n-p\nc' + run assert_line -- '-p' + [ "$status" -eq 0 ] + [ "${#lines[@]}" -eq 0 ] +} diff --git a/test/50-assert-18-refute_line.bats b/test/50-assert-18-refute_line.bats index 30bbcba..9cc8185 100755 --- a/test/50-assert-18-refute_line.bats +++ b/test/50-assert-18-refute_line.bats @@ -333,3 +333,10 @@ test_index_r_regexp () { [ "${lines[1]}" == "Invalid extended regular expression: \`[.*'" ] [ "${lines[2]}" == '--' ] } + +@test "refute_line(): \`--' stops parsing options" { + run printf 'a\n--\nc' + run refute_line -- '-p' + [ "$status" -eq 0 ] + [ "${#lines[@]}" -eq 0 ] +} |