Skip to content

Commit 2e1decc

Browse files
Terence JeongTerence Jeong
authored andcommitted
fixed elif in find_fail to handle if no error field is present
1 parent 35529d4 commit 2e1decc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

detection.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ find_fail(){
1515
file=$2
1616
suite_line=$(cat "$file" | grep "$target")
1717
if echo "$suite_line" | grep "failures=\"0\"";then
18-
if echo "$suite_line" | grep "errors=\"0\"";then
18+
if echo "$suite_line" | grep -L "errors=\"0\"";then
19+
return 0
20+
else
21+
echo "Error found in $file: $suite_line"
22+
return 1
23+
fi
24+
elif echo "$suite_line" | grep -L "errors=\"0\"";then
25+
if echo "$suite_line" | grep "failures=\"0\"";then
1926
return 0
2027
else
2128
echo "Error found in $file: $suite_line"

0 commit comments

Comments
 (0)