"""results.formats — txt/srt/vtt.""" from __future__ import annotations from luke_scribe.results import formats SEGS = [ {"start": 0.0, "end": 1.5, "text": "안녕 world"}, {"start": 1.5, "end": 3.0, "text": "두번째"}, ] def test_txt(): assert formats.to_txt(SEGS) == "안녕 world\n두번째" def test_srt(): out = formats.to_srt(SEGS) assert "1\n00:00:00,000 --> 00:00:01,500\n안녕 world" in out assert "2\n00:00:01,500 --> 00:00:03,000\n두번째" in out def test_vtt(): out = formats.to_vtt(SEGS) assert out.startswith("WEBVTT") assert "00:00:00.000 --> 00:00:01.500" in out