fix: escape special characters in save_config TOML output

This commit is contained in:
2026-04-10 21:02:36 +02:00
parent 1637314c1d
commit 484df3b9fd
2 changed files with 18 additions and 5 deletions
+8
View File
@@ -105,3 +105,11 @@ class TestSaveConfig:
path = tmp_path / "subdir" / "config.toml"
save_config(Config(), path)
assert path.exists()
def test_save_handles_special_characters_in_microphone(self, tmp_path):
from whisper_local.config import save_config
path = tmp_path / "config.toml"
config = Config(microphone='USB "Pro" Mic')
save_config(config, path)
loaded = load_config(path)
assert loaded.microphone == 'USB "Pro" Mic'