Skip to content
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

fix: University tests #1411

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

kingthorin
Copy link
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.

Copy link

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
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
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 <[email protected]>
@kingthorin
Copy link
Collaborator Author

@asolntsev fixed.

Copy link

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
12 checks passed
@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