Skip to content

Commit

Permalink
bcf/record/samples/series/tests: Add test for missing characters in a…
Browse files Browse the repository at this point in the history
…rray
  • Loading branch information
zaeleus committed May 24, 2024
1 parent 297085b commit d383b80
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions noodles-bcf/src/record/samples/series.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,9 @@ mod tests {
let header = build_header_with_format(NAME, Number::Count(2), format::Type::Character);
let id = header.string_maps().strings().get_index_of(NAME).unwrap();
let src = &[
b'n', 0x00, 0x00, // "n"
b'n', b',', b'd', // "n,d"
b'n', b',', b'd', // [Some('n'), Some('d')]
b'n', b',', b'.', // [Some('n'), None]
b'n', 0x00, 0x00, // [Some('n')]
];

let series = Series {
Expand All @@ -403,10 +404,11 @@ mod tests {
src,
};

t(&series, &header, 0, &[Some('n')]);
t(&series, &header, 1, &[Some('n'), Some('d')]);
t(&series, &header, 0, &[Some('n'), Some('d')]);
t(&series, &header, 1, &[Some('n'), None]);
t(&series, &header, 2, &[Some('n')]);

assert!(series.get(&header, 2).is_none());
assert!(series.get(&header, 3).is_none());
}

#[test]
Expand Down

0 comments on commit d383b80

Please sign in to comment.