Skip to content

Commit 4dbd5eb

Browse files
committed
fix(test): make test happy
1 parent b1e6f5f commit 4dbd5eb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/#588.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
sys.path.append(now_dir)
88

99
import logging
10+
import re
1011

1112
import ChatTTS
1213

@@ -31,8 +32,13 @@
3132
params_refine_text=ChatTTS.Chat.RefineTextParams(show_tqdm=False),
3233
)
3334

35+
trimre = re.compile("\\[[\w_]+\\]")
36+
def trim_tags(txt: str) -> str:
37+
global trimre
38+
return trimre.sub("", txt)
39+
3440
for i, t in enumerate(refined):
35-
if len(t) > 4 * len(texts[i]):
41+
if len(t) > 4 * len(trim_tags(texts[i])):
3642
fail = True
3743
logger.warning("in: %s, out: %s", texts[i], t)
3844

0 commit comments

Comments
 (0)