1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-23 10:19:56 +00:00

Enhanced unit test for rightposition (#37)

Added additional tests for SAM.Record and BAM.Record for `rightposition` (and implicitly `alignlength`).
This commit is contained in:
herbstk 2020-01-05 22:18:36 +05:30 committed by Ciarán O'Mara
parent 8d14563f9d
commit 6a33ac06a7

View file

@ -151,6 +151,10 @@ end
@test eof(reader) @test eof(reader)
close(reader) close(reader)
# rightposition (also implicitly alignlength)
records = collect(open(SAM.Reader, joinpath(samdir, "ce#5b.sam")))
@test SAM.rightposition(records[6]) == rightposition(records[6]) == 83
# iterator # iterator
@test length(collect(open(SAM.Reader, joinpath(samdir, "ce#1.sam")))) == 1 @test length(collect(open(SAM.Reader, joinpath(samdir, "ce#1.sam")))) == 1
@test length(collect(open(SAM.Reader, joinpath(samdir, "ce#2.sam")))) == 2 @test length(collect(open(SAM.Reader, joinpath(samdir, "ce#2.sam")))) == 2
@ -308,6 +312,10 @@ end
@test record.tlen == new_record.tlen @test record.tlen == new_record.tlen
@test record.data == new_record.data @test record.data == new_record.data
# rightposition (also implicitly alignlength)
records = collect(open(BAM.Reader, joinpath(bamdir, "ce#5b.bam")))
@test BAM.rightposition(records[6]) == rightposition(records[6]) == 83
# iterator # iterator
@test length(collect(open(BAM.Reader, joinpath(bamdir, "ce#1.bam")))) == 1 @test length(collect(open(BAM.Reader, joinpath(bamdir, "ce#1.bam")))) == 1
@test length(collect(open(BAM.Reader, joinpath(bamdir, "ce#2.bam")))) == 2 @test length(collect(open(BAM.Reader, joinpath(bamdir, "ce#2.bam")))) == 2