From eb72584e579b841716ea6543438d71eb79928f3b Mon Sep 17 00:00:00 2001 From: Vladimir Mikryukov Date: Sat, 19 Oct 2024 14:40:27 +0300 Subject: [PATCH] add `test_custom_name` test --- test/test2_binary.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/test2_binary.sh b/test/test2_binary.sh index 6534ef4..86b24cd 100644 --- a/test/test2_binary.sh +++ b/test/test2_binary.sh @@ -25,6 +25,25 @@ EOF fi } +# Test custom name +function test_custom_name { + result=$(../seqhasher --name "custom_name" test2.fasta -) + expected=$(cat <custom_name;e2512172abf8cc9f67fdd49eb6cacf2df71bbad3;seq1 +AAAA +>custom_name;65c89f59d38cdbf90dfaf0b0a6884829df8396b0;seq2 +ACTG +>custom_name;e2512172abf8cc9f67fdd49eb6cacf2df71bbad3;seq3 +AAAA +EOF +) + if [[ "$result" != "$expected" ]]; then + echo -e "\e[31mCustom name test failed\e[0m" + failed=1 + else + echo -e "\e[32mCustom name test passed\e[0m" + fi +} # Test headers only function test_headers_only { @@ -87,6 +106,7 @@ EOF } test_basic_usage +test_custom_name test_headers_only test_no_filename test_xxhash_case_sensitive