Skip to content

Commit 49c94a8

Browse files
authored
Increase test coverage (#11)
1 parent 90f3ae3 commit 49c94a8

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# .git-blame-ignore-revs # switch formatter to Runic
2+
90f3ae3686d5e64b38dbad7bce7c1867be0a4b57

src/sam.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function validate_array(T::Type, mem::ImmutableMemoryView{UInt8})::Bool
176176
length(mem) == 1 && return false
177177
@inbounds(mem[1]) == UInt8(',') || return false
178178
return all(split_each(@inbounds(mem[2:end]), UInt8(','))) do bytes
179-
!isnothing(tryparse(T, bytes))
179+
!isnothing(tryparse(T, StringView(bytes)))
180180
end
181181
end
182182

test/runtests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ end
298298
@test isempty(MemoryView(aux))
299299
end
300300

301+
@testset "isvalid" begin
302+
s = "ab:i:4\tka:A:m\ttp:f:0.2123\tmn:H:13af\tAC:B:c,3,2,-34,25,62,-123"
303+
aux = SAM.Auxiliary(collect(codeunits(s)), 1)
304+
@test isvalid(aux)
305+
end
306+
301307
end # SAM
302308

303309
@testset "BAM" begin
@@ -519,6 +525,12 @@ end # SAM
519525
end
520526
end
521527

528+
@testset "isvalid" begin
529+
s = "abAcbbHafde01\0kaZabcdefgh\0kkC8mnBC\3\0\0\0abc"
530+
aux = BAM.Auxiliary(collect(codeunits(s)), 1)
531+
@test isvalid(aux)
532+
end
533+
522534
end # BAM
523535

524536
@testset "Arrays" begin

0 commit comments

Comments
 (0)