1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-11-17 03:32:27 +01:00

bats_frame_filename normalizes test filenames

This commit is contained in:
Sam Stephenson 2014-08-12 15:14:16 -05:00
parent ec6fbc10f1
commit 81be444b3b

View File

@ -122,13 +122,7 @@ bats_print_stack_trace() {
local count="${#@}" local count="${#@}"
for frame in "$@"; do for frame in "$@"; do
local filename local filename="$(bats_frame_filename "$frame")"
if [ $index -eq $count ]; then
filename="$BATS_TEST_FILENAME"
else
filename="$(bats_frame_filename "$frame")"
fi
local lineno="$(bats_frame_lineno "$frame")" local lineno="$(bats_frame_lineno "$frame")"
if [ $index -eq 1 ]; then if [ $index -eq 1 ]; then
@ -154,16 +148,9 @@ bats_print_stack_trace() {
bats_print_failed_command() { bats_print_failed_command() {
local frame="$1" local frame="$1"
local count="${#@}" local filename="$(bats_frame_filename "$frame")"
local filename
if [ $count -eq 1 ]; then
filename="$BATS_TEST_FILENAME"
else
filename="$(bats_frame_filename "$frame")"
fi
local lineno="$(bats_frame_lineno "$frame")" local lineno="$(bats_frame_lineno "$frame")"
local failed_line="$(bats_extract_line "$filename" "$lineno")" local failed_line="$(bats_extract_line "$filename" "$lineno")"
local failed_command="$(bats_strip_string "$failed_line")" local failed_command="$(bats_strip_string "$failed_line")"