Skip to content

Commit

Permalink
Fix tests (#283)
Browse files Browse the repository at this point in the history
Mitigate breaking Julia change for Julia 1.11

Turns out Julia is allowed to change the types of exceptions (#50633), which
I'm pretty miffed about.
Work around this to prevent tests from failing in Julia 1.11 due to Julia
PR #49322.
  • Loading branch information
jakobnissen committed Aug 21, 2023
1 parent 1ccb602 commit 2f9ff46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions test/biosequences/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ end

@testset "BitIndex" begin
ind = BioSequences.BitIndex{4, UInt64}(16)
BioSequences.BitsPerSymbol(ind) = BioSequences.BitsPerSymbol{4}()
BioSequences.bitwidth(UInt64) = 64
BioSequences.bitwidth(UInt16) = 16
BioSequences.prevposition(ind) == BioSequences.BitIndex{4, UInt64}(12)
BioSequences.nextposition(ind) == BioSequences.BitIndex{4, UInt64}(20)
end
@test BioSequences.BitsPerSymbol(ind) == BioSequences.BitsPerSymbol{4}()
@test BioSequences.bitwidth(UInt64) == 64
@test BioSequences.bitwidth(UInt16) == 16
@test BioSequences.prevposition(ind) == BioSequences.BitIndex{4, UInt64}(12)
@test BioSequences.nextposition(ind) == BioSequences.BitIndex{4, UInt64}(20)
end
6 changes: 3 additions & 3 deletions test/search/pwm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
@test maxscore(pwm) sum(maximum(raw, dims=1))
@test maxscore(PWM{DNA}(zeros(4, 0))) === 0.0
@test PWM(pfm .+ 0.1) isa PWM{DNA,Float64} # pseudo count
@test_throws ArgumentError PWM{DNA}(hcat(m, [13, 14, 15]))
@test_throws ArgumentError PWM(pfm, prior=normalize([0,1,2,3], 1))
@test_throws ArgumentError PWM(pfm, prior=normalize([0,1,2,3], 1).+1e-3)
@test_throws Exception PWM{DNA}(hcat(m, [13, 14, 15]))
@test_throws Exception PWM(pfm, prior=normalize([0,1,2,3], 1))
@test_throws Exception PWM(pfm, prior=normalize([0,1,2,3], 1).+1e-3)
@test all(pwm[i] === pwm[i] for i in eachindex(pwm))
@test all(pwm[i,j] === raw[i,j] for i in 1:4, j in 1:3)
@test all(pwm[ACGT[i],j] === pwm[i,j] for i in 1:4, j in 1:3)
Expand Down

0 comments on commit 2f9ff46

Please sign in to comment.