From 560a5cd8dfb5d6c732c4e37ecc6c2c30f9986a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20O=27Mara?= Date: Tue, 2 May 2023 14:56:48 +1000 Subject: [PATCH] Check that EOF_BLOCK gets written --- test/test_bam.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/test_bam.jl b/test/test_bam.jl index f10bb72..47cb3f4 100644 --- a/test/test_bam.jl +++ b/test/test_bam.jl @@ -209,6 +209,14 @@ close(reader) close(writer) + + # Check that EOF_BLOCK gets written. + nbytes = filesize(path) + @test BAM.BGZFStreams.EOF_BLOCK == open(path) do io + seek(io, nbytes - length(BAM.BGZFStreams.EOF_BLOCK)) + read(io) + end + reader = open(BAM.Reader, path) @test header(reader) == header_original @@ -247,12 +255,12 @@ index = BAM.BAI(filepath * ".bai") reader = open(BAM.Reader, filepath, index=index) - + @test isa(eachoverlap(reader, "chr1", 1:100), BAM.OverlapIterator) close(reader) - @test_throws ErrorException open(BAM.Reader, filepath, index=1234) + @test_throws ErrorException open(BAM.Reader, filepath, index=1234) end