ruby : fix segmentation fault (#3591)

* Mark long live variable

* Fix test for Whisper::Token#deconstruct_keys(nil)

* Don't use long live variable

* Fix indentation
This commit is contained in:
KITAITI Makoto
2026-01-05 17:41:22 +09:00
committed by GitHub
parent e9898ddfb9
commit 679bdb53db
4 changed files with 30 additions and 34 deletions
+3 -1
View File
@@ -57,7 +57,9 @@ class TestToken < TestBase
end
def test_deconstruct_keys_with_nil
assert_equal({}, @token.deconstruct_keys(nil))
keys = %i[id tid probability log_probability pt ptsum t_dtw voice_length start_time end_time text]
expected = keys.collect {|key| [key, @token.send(key)] }.to_h
assert_equal(expected, @token.deconstruct_keys(nil))
end
def test_deconstruct_keys_with_keys