Skip to content

Commit fc65123

Browse files
Merge pull request #92 from developer0hye/fix/remaining-xlsx-failures
fix: resolve all 9 remaining XLSX parsing failures
2 parents d120b3a + fc65ae1 commit fc65123

File tree

1 file changed

+18
-34
lines changed

1 file changed

+18
-34
lines changed

crates/office2pdf/tests/xlsx_fixtures.rs

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -388,47 +388,40 @@ xlsx_fixture_tests!(
388388
/// Files that previously panicked in umya-spreadsheet now convert successfully
389389
/// after the fork fix (developer0hye/umya-spreadsheet fix/panic-safety-v2).
390390
///
391-
/// 12 of 15 previously-panicking files now produce valid PDFs.
391+
/// All 21 previously-panicking files now produce valid PDFs.
392392
#[test]
393393
fn previously_panicking_files_now_convert() {
394394
let cases: &[&str] = &[
395-
// FileNotFound panics (7 files — all now succeed)
395+
// --- Phase 1 fixes (PR #90) ---
396+
// FileNotFound panics (7 files)
396397
"libreoffice/chart_hyperlink.xlsx",
397398
"libreoffice/hyperlink.xlsx",
398399
"libreoffice/tdf130959.xlsx",
399400
"libreoffice/test_115192.xlsx",
400401
"poi/47504.xlsx",
401402
"poi/bug63189.xlsx",
402403
"poi/ConditionalFormattingSamples.xlsx",
403-
// ParseFloatError / boolean cell (1 file — now succeeds)
404+
// ParseFloatError / boolean cell (1 file)
404405
"libreoffice/check-boolean.xlsx",
405-
// unwrap() on None (2 of 3 now succeed)
406+
// unwrap() on None (2 files)
406407
"libreoffice/tdf100709.xlsx",
407408
"poi/sample-beta.xlsx",
408-
// dataBar end element (2 files — both now succeed)
409+
// dataBar end element (2 files)
409410
"libreoffice/tdf162948.xlsx",
410411
"poi/NewStyleConditionalFormattings.xlsx",
411-
];
412-
for name in cases {
413-
let path = fixture_path(name);
414-
if !path.exists() {
415-
eprintln!("Skipping {name}: fixture not available");
416-
continue;
417-
}
418-
assert_produces_valid_pdf(name);
419-
}
420-
}
421-
422-
/// 3 previously-panicking files still fail but now return clean errors
423-
/// (no process crash). These have deeper arithmetic overflow / missing data
424-
/// issues in umya-spreadsheet that our patch does not address.
425-
#[test]
426-
fn remaining_panic_files_return_clean_errors() {
427-
let cases: &[&str] = &[
428-
// ParseIntError PosOverflow → arithmetic overflow in formula parsing
412+
// --- Phase 2 fixes ---
413+
// Backslash zip paths from Windows tools (3 files)
414+
"libreoffice/tdf131575.xlsx",
415+
"libreoffice/tdf76115.xlsx",
416+
"poi/49609.xlsx",
417+
// Missing optional styles.xml (3 files)
418+
"poi/56278.xlsx",
419+
"libreoffice/tdf121887.xlsx",
420+
"poi/59021.xlsx",
421+
// Arithmetic overflow in formula parsing (2 files)
429422
"libreoffice/functions-excel-2010.xlsx",
430423
"poi/FormulaEvalTestData_Copy.xlsx",
431-
// unwrap() on None in a different code path
424+
// Missing XML attributes (1 file)
432425
"poi/64450.xlsx",
433426
];
434427
for name in cases {
@@ -437,16 +430,7 @@ fn remaining_panic_files_return_clean_errors() {
437430
eprintln!("Skipping {name}: fixture not available");
438431
continue;
439432
}
440-
let data = std::fs::read(&path).unwrap();
441-
let result = office2pdf::convert_bytes(
442-
&data,
443-
office2pdf::config::Format::Xlsx,
444-
&ConvertOptions::default(),
445-
);
446-
assert!(
447-
result.is_err(),
448-
"{name} should return Err (still has upstream issues)"
449-
);
433+
assert_produces_valid_pdf(name);
450434
}
451435
}
452436

0 commit comments

Comments
 (0)