Skip to content

Commit

Permalink
Use process substitution instead of here-string
Browse files Browse the repository at this point in the history
This fixes an issue where if no test cases are found, an empty test case name would be output and counted towards the total number of test cases.
  • Loading branch information
MartyO256 committed Jan 27, 2024
1 parent 8e17136 commit 52cb6b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions TEST.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function do_testing {
start_test_case "${file_path}"

check_example_test_case "${file_path}"
done <<< "$(find_compiler_tests_in "${STUDYDIR}" | sort -n)"
done < <(find_compiler_tests_in "${STUDYDIR}" | sort -n)
fi

if [[ -n "${RUN_EXAMPLES_TESTS}" ]]; then
Expand All @@ -143,7 +143,7 @@ function do_testing {
start_test_case "${file_path}"

check_example_test_case "${file_path}"
done <<< "$(find_compiler_tests_in "${EXAMPLEDIR}" | sort -n)"
done < <(find_compiler_tests_in "${EXAMPLEDIR}" | sort -n)
fi

if [[ -n "${RUN_COMPILER_TESTS}" ]]; then
Expand All @@ -153,7 +153,7 @@ function do_testing {
start_test_case "${file_path}"

check_compiler_test_case "${file_path}"
done <<< "$(find_compiler_tests_in "${TESTDIR}" | sort -n)"
done < <(find_compiler_tests_in "${TESTDIR}" | sort -n)
fi

if [[ -n "${RUN_INTERACTIVE_MODE_TESTS}" ]]; then
Expand All @@ -163,7 +163,7 @@ function do_testing {
start_test_case "${file_path}"

check_interactive "${file_path}"
done <<< "$(find "${INTERACTIVE_TESTDIR}" -type f | sort -n)"
done < <(find "${INTERACTIVE_TESTDIR}" -type f | sort -n)
fi

if [[ -n "${RUN_HARPOON_MODE_TESTS}" ]]; then
Expand All @@ -173,7 +173,7 @@ function do_testing {
start_test_case "${file_path}"

check_harpoon "${file_path}"
done <<< "$(find "${HARPOON_TESTDIR}" -type f -name "*.input" | sort -n)"
done < <(find "${HARPOON_TESTDIR}" -type f -name "*.input" | sort -n)
fi

echo
Expand Down

0 comments on commit 52cb6b1

Please sign in to comment.