Skip to content

Commit

Permalink
Add tests for deprecated interface
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOresten committed Nov 28, 2024
1 parent 53da034 commit 105b05e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,17 @@ using Random

end

@testset "deprecated.jl" begin
logits = log.([0.1, 0.2, 0.3, 0.4])
@test argmax_sampler(logits) isa Integer
@test_throws BoundsError top_pk_sampler(logits) # k defaults to 5
@test top_pk_sampler(logits; k = 3) isa Integer
@test min_p_sampler(logits) isa Integer
@test top_nσ_sampler(logits) isa Integer
@test argmax_sampler() isa Function
@test top_pk_sampler() isa Function
@test min_p_sampler() isa Function
@test top_nσ_sampler() isa Function
end

end

0 comments on commit 105b05e

Please sign in to comment.