Skip to content

Commit 708c771

Browse files
Apply suggested fix to tests/sparql_qc/run_sparql_metatest.sh from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 3ffdc20 commit 708c771

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/sparql_qc/run_sparql_metatest.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ for q in "${queries[@]}"; do
4444
name="$(basename "$q")"
4545
res="$OUT/$name.tsv"
4646
robot query --input "$FIXTURE" --query "$q" "$res"
47-
rows=$(($(wc -l < "$res") - 1)) # the first line is the SELECT header
47+
raw_rows=$(wc -l < "$res")
48+
rows=$((raw_rows - 1)) # first line is SELECT header when present
49+
if [ "$rows" -lt 0 ]; then rows=0; fi
4850
if [ "$rows" -ge 1 ]; then
4951
echo "OK $name matched $rows fixture violation(s)"
5052
else

0 commit comments

Comments
 (0)