mirror of
https://github.com/sstephenson/bats.git
synced 2024-12-26 14:39:46 +01:00
fix preprocessing tests that have lines beginning with -e
This commit is contained in:
parent
5030f53ecc
commit
7cec3d6259
|
@ -42,7 +42,7 @@ while IFS= read -r line; do
|
|||
tests["${#tests[@]}"]="$encoded_name"
|
||||
echo "${encoded_name}() { bats_test_info ${quoted_name} ${index}"
|
||||
else
|
||||
echo "$line"
|
||||
printf "%s\n" "$line"
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
|
@ -97,3 +97,9 @@ fixtures bats
|
|||
[ $status -eq 0 ]
|
||||
[ "$output" = "4" ]
|
||||
}
|
||||
|
||||
@test "dash-e is not mangled on beginning of line" {
|
||||
run bats "$FIXTURE_ROOT/intact.bats"
|
||||
[ $status -eq 0 ]
|
||||
[ "${lines[1]}" = "ok 1 dash-e on beginning of line" ]
|
||||
}
|
||||
|
|
6
test/fixtures/bats/intact.bats
vendored
Normal file
6
test/fixtures/bats/intact.bats
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
@test "dash-e on beginning of line" {
|
||||
run cat - <<INPUT
|
||||
-e
|
||||
INPUT
|
||||
test "$output" = "-e"
|
||||
}
|
Loading…
Reference in New Issue
Block a user