Skip to content

Commit

Permalink
[DOR-895] Change test value so that it doesn't match the default
Browse files Browse the repository at this point in the history
As spotted in !1266, there'd be no difference in behaviour between this
test doing the right or wrong thing since they'd both return the same
value.
  • Loading branch information
blawrence-ont committed Nov 13, 2024
1 parent b9521e6 commit 86ff2f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
10 changes: 6 additions & 4 deletions tests/BamReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@ TEST_CASE("HtsReaderTest: get_tag", TEST_GROUP) {

dorado::HtsReader reader(sam.string(), std::nullopt);
while (reader.read()) {
// All records in small.sam have this set to 0.
CHECK(reader.get_tag<int>("rl") == 0);
// All records in small.sam have these set.
CHECK(reader.get_tag<int>("XA") == 42);
CHECK(reader.get_tag<std::string>("XB") == "test");
// Intentionally bad tag to test that missing tags don't return garbage.
CHECK(reader.get_tag<int>("##") == 0);
CHECK(reader.get_tag<float>("##") == 0);
CHECK(reader.get_tag<std::string>("##") == "");
// Type mismatch doesn't crash.
CHECK(reader.get_tag<float>("rl") == 0);
CHECK(reader.get_tag<std::string>("rl") == "");
CHECK(reader.get_tag<int>("XB") == 0);
CHECK(reader.get_tag<float>("XB") == 0);
CHECK(reader.get_tag<std::string>("XA") == "");
}
}

Expand Down
Loading

0 comments on commit 86ff2f9

Please sign in to comment.