Skip to content

test: make the OFD, spreadsheet and preset-editor tests locale-independent - #1033

Merged
KnifeLemon merged 1 commit into
mainfrom
fix/locale-independent-tests
Nov 3, 2026
Merged

KnifeLemon merged 1 commit into
mainfrom
fix/locale-independent-tests

Conversation

@KnifeLemon

Copy link
Copy Markdown
Owner

Some tests fail on a German system although the code they test is right. This makes them pass whatever the regional format is.

  • OfdTests: the test OFD packages were written with culture-formatted numbers (Size="3,5" instead of 3.5), so the reader got broken markup. The markup is now built with CultureInfo.InvariantCulture.
  • SpreadsheetFormatTests.LibreOffice_reads_our_ods_and_we_read_its_ods_and_xls: an ODS saved by LibreOffice keeps the text Calc showed, with Calc's own separators (1.350.000원, 12,8 % on a German system). That case is now compared without the separators. The XLS column width gets the same 25% tolerance as ODS, because LibreOffice measures Korean text with its locale's East Asian font; the column ratio check stays.
  • RenderTests: the two preset-editor tests (Preset_editor_saves_every_frame_only_for_png_and_jpg, Preset_editor_shows_playback_speed_only_for_targets_that_keep_animations) check labels whose numbers follow the regional format (100,000, 0.25×). They now pin en-US / ko-KR for the test.

Tests only, no product code.

Verified locally by forcing de-DE through a temporary module initializer (not committed): on main, 8 OfdTests and both preset-editor tests fail under de-DE; with this change all of them pass under de-DE and under the default ko-KR. The LibreOffice cross-check skips without LibreOffice installed, so that part wasn't run here.

Split out of #583 by @jojofox0815, who wrote the original change.

🤖 Generated with Claude Code

…ndent

On a German system these tests failed although the code under test was
right: the OFD test packages were built with culture-formatted numbers
("3,5" instead of "3.5"), the LibreOffice cross-check compared text Calc
had formatted with its own locale's separators, and the two preset-editor
tests checked labels that follow the regional format. Build the OFD
markup with the invariant culture, compare the ODS-by-LibreOffice text
without separators (and allow the XLS column width the same tolerance,
since LibreOffice measures Korean text with its locale's East Asian
font), and pin the culture in the two preset-editor tests.

Co-authored-by: jojofox0815 <125126720+jojofox0815@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KnifeLemon
KnifeLemon merged commit 824ea3d into main Nov 3, 2026
21 of 23 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