Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
bats_frame_filename normalizes test filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed Aug 12, 2014
1 parent ec6fbc1 commit 81be444
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions libexec/bats-exec-test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")"

Expand Down

0 comments on commit 81be444

Please sign in to comment.