Skip to content

MBS-14050: Add tests for find_best_primary_alias #3556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

reosarevok
Copy link
Member

Implement MBS-14050

Description

I think I covered all the main cases here: exact locale match, fallback to language default, fallback to English, skipping non-primary aliases, skipping ended aliases. Happy to add more cases if I missed something :)

@reosarevok reosarevok added the Tests PRs that mostly create or update tests label Jun 5, 2025
@derat
Copy link
Contributor

derat commented Jun 5, 2025

Nice!

It might be worthwhile passing different alias lists to test what happens when there are no primary aliases at all, e.g.

  • Alias exists for requested locale, but no aliases are primary
  • Alias exists for different locale with same language, but no aliases are primary
  • Alias exists for English, but no aliases are primary

(Maybe those are already covered by the existing "no aliases" case if the code starts by filtering out all non-primary aliases, though.)

Might also be worth testing what happens when there's no English primary alias to fall back to, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tests PRs that mostly create or update tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants