test(mineru): dump parsed markdown for live content proof

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-21 11:10:42 +00:00
co-authored by Cursor
parent db76a28689
commit c026ad7160
+6
View File
@@ -53,6 +53,12 @@ func TestLive_ParseTinyPDF(t *testing.T) {
if pdfPath != "" && res.EngineMode == "" {
t.Fatal("missing engine mode")
}
// Dump a content sample so the report can prove real text was extracted.
if os.Getenv("MINERU_LIVE_DUMP") != "" {
_ = os.WriteFile(os.Getenv("MINERU_LIVE_DUMP"), []byte(res.Markdown), 0o644)
t.Logf("wrote %d bytes to %s; contains 冲击波=%v",
len(res.Markdown), os.Getenv("MINERU_LIVE_DUMP"), strings.Contains(res.Markdown, "冲击波"))
}
}
func getenv(k, def string) string {