Skip to content

fix: University tests#1411

Merged
asolntsev merged 1 commit into
datafaker-net:mainfrom
kingthorin:univ-test-fix
Oct 28, 2024
Merged

fix: University tests#1411
asolntsev merged 1 commit into
datafaker-net:mainfrom
kingthorin:univ-test-fix

Conversation

@kingthorin
Copy link
Copy Markdown
Collaborator

@kingthorin kingthorin commented Oct 27, 2024

Extended the expected regex to include a few characters with accents.

Addresses #1404 (comment)

Add recently introduced test artifact test.txt to .gitignore

FYI if anyone needs to run single UnitTest classes or methods locally you can use:
./mvnw test -Dtest=UniversityTest
./mvnw test -Dtest=UniversityTest#testName
syntax.

@what-the-diff
Copy link
Copy Markdown

what-the-diff Bot commented Oct 27, 2024

PR Summary

  • Creating a Constant For University Name Matching
    In the UniversityTest.java, a new constant UNIVERSITY_MATCHER was introduced. This constant is used to find and verify university names based on certain rules, making the matching process consistent and easy to manage.

  • Improving the testName Method
    The testName method was adjusted to employ the newly created UNIVERSITY_MATCHER. Previously, it used a less flexible, hard-coded matching pattern, so this change should make the testName method more adaptable and efficient.

  • Updating the Provider List Test Method
    The providerListTest method was changed to incorporate the UNIVERSITY_MATCHER for testing the university.place specification. This adjustment will make its testing protocol more consistent with other tests that use the same university name matching rule.

Copy link
Copy Markdown
Collaborator

@asolntsev asolntsev left a comment

Choose a reason for hiding this comment

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

  1. Why it's needed to ignore file "test.txt"? I don't see any tests that would create such a file.
  2. This regex is not enough. UniversityTest still can fail:
java.lang.AssertionError: 
Expecting actual:
  "North Leffler Academy of Aix-Marseille"
to match pattern:
  "[A-Za-z'() öèü]+"

@kingthorin
Copy link
Copy Markdown
Collaborator Author

Oops thanks, I didn’t account for hyphen or other chars, I had searched non-ASCII.

I’ll dig into the test.txt thing, maybe it was something I’d polluted the repo with somehow.

Extended the expected regex to include a few characters with accents.

Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
@kingthorin
Copy link
Copy Markdown
Collaborator Author

@asolntsev fixed.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.25%. Comparing base (0f09cee) to head (f1f0db1).
Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1411      +/-   ##
============================================
+ Coverage     92.21%   92.25%   +0.04%     
- Complexity     3149     3151       +2     
============================================
  Files           319      319              
  Lines          6149     6149              
  Branches        591      591              
============================================
+ Hits           5670     5673       +3     
+ Misses          334      333       -1     
+ Partials        145      143       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asolntsev asolntsev self-requested a review October 28, 2024 05:18
@asolntsev asolntsev merged commit 9efbce1 into datafaker-net:main Oct 28, 2024
@kingthorin kingthorin deleted the univ-test-fix branch October 28, 2024 08:50
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.

2 participants