Skip to content

[Enhancement] Improve test coverage and cleanup for EscapeHexCellWriteHandler #1000

Description

@nkuprins

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

While working on #991, I noticed that EscapeHexCellWriteHandler has no dedicated tests, and the pattern-scanning code has some edges worth tidying.

Solution

I will do it in 2 PR.

1. Testing

  • Cover the escaping logic itself - valid patterns get rewritten, invalid/edge-case ones don't,
    and non-applicable inputs (wrong cell data type, null values) are safely ignored.
  • Cover it end-to-end - write a file through Fesod with the handler registered and confirm the
    escaped value survives being read back.

2. Refactoring/cleanup

Hold off reviewing this section until 1. is merged - the tests need to pin current behaviour before
anything underneath them moves.

  • Reduce duplication in the pattern-scanning code - the match-detection logic is currently
    written out twice across two methods.
  • Improve readability of the low-level string offsets (magic numbers, member ordering), so the
    logic is easier to verify by inspection.

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions