Skip to content

Commit

Permalink
Update test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaspe committed Jul 24, 2024
1 parent 4bcad98 commit 7313e05
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/fastqc/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,19 @@ echo "-> Run Test: multiple options"
diff -a "test_data/expected_summary.txt" "test_data/input_1_fastqc/summary.txt" \
|| (echo "Output summary file does not match expected output" && exit 1)

# Checking for contaminants in fastqc_data.txt
echo "Checking for contaminants in fastqc_data.txt"
result=$(cat test_data/input_1_fastqc/fastqc_data.txt | grep "contaminant" )
expecte_result=$(printf "CACTTGTAAGGGCAGGCCCCCTTCACCCTCCCGCTCCTGGGGGANNNNNN\t1\t100.0\tcontaminant_sequence1 (100%% over 44bp)\n")

[ -z "$result" ] && echo "Contaminants not found in fastqc_data.txt" && exit 1

[ "$result" != "$expecte_result" ] \
&& echo "Contaminants do not match expected output" \
&& echo "Result: $result" \
&& echo "Expected: $expecte_result" \
&& exit 1

rm -r "test_data/input_1_fastqc"
rm "test_data/input_1_fastqc.html"
rm "test_data/input_1_fastqc.zip"
Expand Down

0 comments on commit 7313e05

Please sign in to comment.