Files
DeepTutor/tests/services/test_mastery_hints.py
Marcello Pichini 863327af2a fix(hints): keep leading -, * and # that belong to the hint (#2852)
The composer-hint sanitizers used lstrip("-•*# ") to drop list markers,
which also ate the sign of "-3 squared...?", the star of "*args" and
the hash of "#include". Strip a marker only when whitespace follows it.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:25:50 +08:00

11 lines
425 B
Python

"""Focused tests for the mastery study composer's ask-hint sanitizer."""
from __future__ import annotations
from deeptutor.services import mastery_hints
def test_sanitize_strips_list_markers_but_keeps_leading_text() -> None:
assert mastery_hints._sanitize("• Why does it converge?", "en") == "Why does it converge?"
assert mastery_hints._sanitize("-2 times -3 is positive?", "en") == "-2 times -3 is positive?"