Skip to content

test(i18n): cover ParseLocale cases#1293

Merged
andrinoff merged 2 commits into
floatpane:masterfrom
superShen0916:test/parse-locale-cases
May 18, 2026
Merged

test(i18n): cover ParseLocale cases#1293
andrinoff merged 2 commits into
floatpane:masterfrom
superShen0916:test/parse-locale-cases

Conversation

@superShen0916
Copy link
Copy Markdown
Contributor

@superShen0916 superShen0916 commented May 15, 2026

What?

Adds table-driven tests for ParseLocale covering:

  • plain, hyphenated, and underscored English locale inputs
  • fallback behavior for an unregistered language
  • invalid empty and malformed locale inputs

Why?

ParseLocale is a small public i18n helper with no dedicated tests. The new tests lock down locale normalization, fallback direction, and invalid-input behavior before more locale work is added.

Fixes #1075

Tests

  • go test ./i18n
  • go test ./...

Signed-off-by: superShen0916 <superShen0916@users.noreply.github.com>
@superShen0916 superShen0916 requested a review from a team as a code owner May 15, 2026 13:02
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @superShen0916! Please fix the following issues with your PR:

  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added bug Something isn't working size/M Diff: 51–200 lines area/i18n Localization / translations labels May 15, 2026
@floatpanebot floatpanebot dismissed their stale review May 15, 2026 13:03

Formatting issues have been resolved. Thank you!

@andrinoff
Copy link
Copy Markdown
Member

@superShen0916 You added no RTL test case, please add the test.

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review comment above

Signed-off-by: superShen0916 <superShen0916@users.noreply.github.com>
@andrinoff andrinoff merged commit 99c6b94 into floatpane:master May 18, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Localization / translations bug Something isn't working size/M Diff: 51–200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Add unit tests for i18n/locale.go

3 participants