Skip to content

add table name validator tests - #111

Merged
andrewtavis merged 2 commits into
scribe-org:mainfrom
ashb155:table-valid
Oct 17, 2026
Merged

andrewtavis merged 2 commits into
scribe-org:mainfrom
ashb155:table-valid

Conversation

@ashb155

@ashb155 ashb155 commented Oct 9, 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

This PR is regarding adding table-driven unit tests for database.IsValidTableName and database.IsValidTranslationTableName.

Test Scenarios

  • Injection Payloads: Tests ;, ; DROP TABLE, UNION SELECT, --, /*, quotes (' OR '1'='1), spaces, and special characters (-).
  • Casing: Enforces case sensitivity on prefixes (en vs EN), connectors (from vs From), language codes, and suffixes (scribe vs Scribe).
  • Suffix & Bounds: Tests missing suffixes, missing language codes, and suffix appending ($) regex regressions.
  • Valid Codes: Tests happy path across 2-letter, 3-letter, and 4-letter language codes.

###Coverage

  • database : 14.7% -> 21.5%

Related issue

@DeleMike

Copy link
Copy Markdown
Member

reviewing...
Sorry, I have been away for a while. I had exams :)

@andrewtavis

Copy link
Copy Markdown
Member

Hope the exams went well, @DeleMike!

@DeleMike

Copy link
Copy Markdown
Member

Yeah, it did! What a week!!...

@DeleMike DeleMike left a comment

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.

I believe this is good to go @ashb155 !

Thank you! 🥇

cc: @andrewtavis

@andrewtavis andrewtavis left a comment

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.

praise: From my end as well this is looking great! Thanks, @ashb155! 😊

@andrewtavis
andrewtavis merged commit f8ad40a into scribe-org:main Oct 17, 2026
3 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.

Add unit tests for database table name validators

3 participants