Make Parakeet tests follow original behavior changes

This commit is contained in:
Kitaiti Makoto 2026-06-09 14:42:50 +09:00
parent cfd0dd1f0e
commit ca3a565fef
3 changed files with 6 additions and 9 deletions

View File

@ -67,18 +67,15 @@ class TestParakeetCallback < TestBase
def test_on_progress
first = nil
last = nil
@params.on_progress do |progress|
assert_kind_of Integer, progress
assert 0 <= progress && progress <= 100
first = progress if first.nil?
last = progress
end
@parakeet.transcribe AUDIO, @params
assert_equal 0, first
assert_equal 90, last
end
def test_on_encoder_begin

View File

@ -41,7 +41,7 @@ class TestParakeetContext < TestBase
@parakeet.full @params, @samples, @samples.length
segments = @parakeet.each_segment.to_a
assert_equal 2, segments.length
assert_equal 1, segments.length
assert_match /ask not what your country can do for you, ask what you can do for your/, segments.first.text
end
@ -49,7 +49,7 @@ class TestParakeetContext < TestBase
@parakeet.full(@params, @samples)
segments = @parakeet.each_segment.to_a
assert_equal 2, segments.length
assert_equal 1, segments.length
assert_match /ask not what your country can do for you, ask what you can do for your/, @parakeet.each_segment.first.text
end
@ -58,7 +58,7 @@ class TestParakeetContext < TestBase
@parakeet.full @params, samples, @samples.length
segments = @parakeet.each_segment.to_a
assert_equal 2, segments.length
assert_equal 1, segments.length
assert_match /ask not what your country can do for you, ask what you can do for your/, @parakeet.each_segment.first.text
end
@ -81,7 +81,7 @@ class TestParakeetContext < TestBase
@parakeet.full @params, samples
segments = @parakeet.each_segment.to_a
assert_equal 2, segments.length
assert_equal 1, segments.length
assert_match /ask not what your country can do for you, ask what you can do for your/, @parakeet.each_segment.first.text
end

View File

@ -32,7 +32,7 @@ class TestParakeetToken < TestBase
i += 1
assert_instance_of Parakeet::Token, token
end
assert_equal 33, i
assert_equal 38, i
end
def test_each_token_without_block
@ -55,7 +55,7 @@ class TestParakeetToken < TestBase
end
def test_text
assert_equal ["▁And", "▁so", ",", "▁my", "▁f", "ell", "ow", "▁Amer", "ic", "ans", ",", "▁a", "sk", "▁not", "▁what", "▁your", "▁co", "un", "tr", "y", "▁can", "▁do", "▁for", "▁you", ",", "▁a", "sk", "▁what", "▁you", "▁can", "▁do", "▁for", "▁your"],
assert_equal ["▁And", "▁so", ",", "▁my", "▁f", "ell", "ow", "▁Amer", "ic", "ans", ",", "▁a", "sk", "▁not", "▁what", "▁your", "▁co", "un", "tr", "y", "▁can", "▁do", "▁for", "▁you", ",", "▁a", "sk", "▁what", "▁you", "▁can", "▁do", "▁for", "▁your", "▁co", "un", "tr", "y", "."],
@segment.each_token.collect(&:text)
end