test: Task1质量审查补测——④真覆盖/③保底覆盖/分组注释/渠道映射查表化
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -200,14 +200,21 @@ def test_reask_wall_channel_precision():
|
||||
索要缺失渠道放行;泛渠道词只要手上有任何号码渠道即丢(宁丢勿放)。"""
|
||||
wa = {"whatsapp"}
|
||||
em = {"email"}
|
||||
# 精确渠道词: ①在手→丢 / ④缺失→放行
|
||||
assert asks_contact("What's your WhatsApp number?", wa) is True
|
||||
assert asks_contact("留个邮箱吧", em) is True
|
||||
assert asks_contact("And an email address would help too", wa) is False
|
||||
assert asks_contact("What's your email address?", wa) is False
|
||||
assert asks_contact("你WhatsApp多少?", em) is False
|
||||
# 泛渠道词: ②手上有号码渠道→丢 / ④无号码渠道(只 email)→放行
|
||||
assert asks_contact("What's your number?", wa) is True
|
||||
assert asks_contact("留个电话呗", wa) is True
|
||||
assert asks_contact("What's your number?", em) is False
|
||||
# 精确+泛同句共存: 按①②自然实现,任一命中判丢
|
||||
assert asks_contact("leave your number or email", wa) is True
|
||||
# ③保底: 命中 REASK 但无任何渠道词("Drop yours too"式重复纠缠)→保守丢
|
||||
assert asks_contact("Drop yours too and our manager will send the quote!",
|
||||
{"phone"}) is True
|
||||
# 无参: 原行为向后兼容(命中即丢/未命中放行)
|
||||
assert asks_contact("What's your WhatsApp number?") is True
|
||||
assert asks_contact("hello there") is False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user