From 81be444b3b44bce2a9e056f2452b025d7289ad42 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 12 Aug 2014 15:14:16 -0500 Subject: [PATCH] `bats_frame_filename` normalizes test filenames --- libexec/bats-exec-test | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/libexec/bats-exec-test b/libexec/bats-exec-test index 8a32505..4ec78ea 100755 --- a/libexec/bats-exec-test +++ b/libexec/bats-exec-test @@ -122,13 +122,7 @@ bats_print_stack_trace() { local count="${#@}" for frame in "$@"; do - local filename - if [ $index -eq $count ]; then - filename="$BATS_TEST_FILENAME" - else - filename="$(bats_frame_filename "$frame")" - fi - + local filename="$(bats_frame_filename "$frame")" local lineno="$(bats_frame_lineno "$frame")" if [ $index -eq 1 ]; then @@ -154,16 +148,9 @@ bats_print_stack_trace() { bats_print_failed_command() { local frame="$1" - local count="${#@}" - - local filename - if [ $count -eq 1 ]; then - filename="$BATS_TEST_FILENAME" - else - filename="$(bats_frame_filename "$frame")" - fi - + local filename="$(bats_frame_filename "$frame")" local lineno="$(bats_frame_lineno "$frame")" + local failed_line="$(bats_extract_line "$filename" "$lineno")" local failed_command="$(bats_strip_string "$failed_line")"