Skip to content

Improve test coverage#11

Merged
maksimovic merged 2 commits intomasterfrom
improve-coverage
Mar 13, 2026
Merged

Improve test coverage#11
maksimovic merged 2 commits intomasterfrom
improve-coverage

Conversation

@maksimovic
Copy link
Copy Markdown
Owner

Adds tests for uncovered methods, improving coverage from 76% to 82% methods and 96.1% to 97.1% lines.

New test files:

  • BuffererWriterTest.php — covers ftell(), fseek(), close(), purge() with UTF-8 validation, large buffer auto-flush
  • XLSXWriterStaticMethodsTest.php — covers xlsCell(), sanitize_sheetname(), log(), add_to_list_get_index(), convert_date_time() edge cases
  • FinalizeSheetTest.php — covers finalizeSheet() with custom options, partial option merging

Add three new test files targeting previously uncovered areas:

- BuffererWriterTest: covers ftell(), fseek(), close(), purge() with
  UTF-8 validation, large buffer auto-flush, and destructor cleanup
- XLSXWriterStaticMethodsTest: covers xlsCell() with absolute refs,
  sanitize_sheetname(), log() with string/array, add_to_list_get_index(),
  and convert_date_time() edge cases (epoch, false leapday, invalid dates)
- FinalizeSheetTest: covers finalizeSheet() with custom print options,
  empty sheet name no-op, idempotent double-finalize, and partial options

Coverage improvement:
- Methods: 76% (38/50) -> 82% (41/50)
- Lines: 96.1% (592/616) -> 97.08% (598/616)
- BuffererWriter methods: 37.5% (3/8) -> 75% (6/8)
- BuffererWriter lines: 72.41% (21/29) -> 93.10% (27/29)
@maksimovic maksimovic merged commit 1281e20 into master Mar 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant