From 105b05e17369b60a00fc13d37a82d233c3066cef Mon Sep 17 00:00:00 2001 From: AntonOresten Date: Thu, 28 Nov 2024 18:11:29 +0100 Subject: [PATCH] Add tests for deprecated interface --- test/runtests.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index d0afcb1..d740683 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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