This commit is contained in:
team3
2026-07-13 01:45:45 +02:00
parent 8cedcc87ec
commit 698bba6ccf
8 changed files with 82 additions and 31 deletions

View File

@@ -366,6 +366,18 @@ def test_split_writer_delimited_und_fallback():
assert guide._split_writer("nur text")[1] == "nur text"
def test_jsonx_repariert_latex_escapes():
# rohes LaTeX im JSON-String (\i = ungültiges Escape) → Reparatur parst
assert jsonx.parse('[{"a": "$\\in \\Sigma$"}]') == [{"a": "$\\in \\Sigma$"}]
# \u ohne 4 Hex-Ziffern (\underline) zählt als ungültig → repariert
assert jsonx.parse('{"m": "\\underline{x}"}') == {"m": "\\underline{x}"}
# gültige Escapes bleiben unberührt (Reparatur nur im Fehlerfall)
assert jsonx.parse('{"x": "a\\nb"}') == {"x": "a\nb"}
assert jsonx.parse('{"u": "\\u00e4"}') == {"u": "ä"}
# echter Müll bleibt None
assert jsonx.parse("kein json hier") is None
def test_writer_saeubern_terminator():
import guide
# geleakter `=====`-Terminator (Setext-H1 unter Bullet) + </s> raus