update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user