Skip to content

Add unit tests for api/validators language code validation - #99

Merged
DeleMike merged 3 commits into
scribe-org:mainfrom
shabicha:add-language-validator-tests
Sep 21, 2026
Merged

DeleMike merged 3 commits into
scribe-org:mainfrom
shabicha:add-language-validator-tests

Conversation

@shabicha

@shabicha shabicha commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Contributor checklist

  • This pull request is on a separate branch and not the main branch
  • I have ran the ./pre-commit executable as well as make lint and have fixed all reported issues

Description

Added language_validator_test.go for api/validators/language_validator.go with table-driven unit tests for IsValidLanguageCode, SanitizeLanguageCode, IsLanguageSupported, IsValidTranslationLangCode and InitLanguageValidator.

Coverage

  • Scribe server test coverage increased from 3.4% to 5.6%.

  • All five functions in language_validator.go are at 100%.

Closes #78

@andrewtavis andrewtavis added the no-changelog No changelog entry is needed for this pull request label Sep 19, 2026
@andrewtavis

Copy link
Copy Markdown
Member

I think we're good to not have a changelog entry for this one :) @DeleMike, could you take a look?

@shabicha

shabicha commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

@andrewtavis added a changelog entry before I saw your comment! Let me know if I should take it out :)

Comment thread CHANGELOG.md Outdated

- Basic health and CORS test scaffolding was added for the API ([#29](https://github.com/scribe-org/Scribe-Server/pull/29)).
- The CI workflow was updated to select the Go version via `go-version-file` ([#8](https://github.com/scribe-org/Scribe-Server/issues/8)) and later improved further ([#30](https://github.com/scribe-org/Scribe-Server/issues/30)).
- - Unit tests were added for the language validator functions ([#78](https://github.com/scribe-org/Scribe-Server/issues/78)).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

note: Totally fine to include this, @shabicha, but let's remove the extra - :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good! I removed the extra -

@DeleMike DeleMike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All looks great to me! Thank you @shabicha !

@DeleMike

Copy link
Copy Markdown
Collaborator

merging...

@DeleMike
DeleMike merged commit 26ab9f3 into scribe-org:main Sep 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No changelog entry is needed for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for api/validators language code validation

3 participants