Skip to content

Respect arg types while looking for method for expressions#1465

Merged
snuyanzin merged 3 commits intodatafaker-net:mainfrom
snuyanzin:1463
Dec 14, 2024
Merged

Respect arg types while looking for method for expressions#1465
snuyanzin merged 3 commits intodatafaker-net:mainfrom
snuyanzin:1463

Conversation

@snuyanzin
Copy link
Copy Markdown
Collaborator

@snuyanzin snuyanzin commented Dec 13, 2024

This will fix #1463

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 13, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 50.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 92.30%. Comparing base (33cbf7d) to head (9db6098).

Files with missing lines Patch % Lines
.../java/net/datafaker/service/FakeValuesService.java 50.00% 9 Missing and 9 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1465      +/-   ##
============================================
- Coverage     92.32%   92.30%   -0.03%     
- Complexity     3234     3245      +11     
============================================
  Files           324      324              
  Lines          6347     6377      +30     
  Branches        610      622      +12     
============================================
+ Hits           5860     5886      +26     
  Misses          343      343              
- Partials        144      148       +4     

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

@snuyanzin snuyanzin force-pushed the 1463 branch 2 times, most recently from 9b6aecd to 12b834e Compare December 13, 2024 14:57
assertThat(faker.expression("#{templatify '????','?','1','2','q','r'}")).matches("([12qr]){4}");
assertThat(faker.expression("#{Name.first_name} #{Name.first_name} #{Name.last_name}")).matches("[a-zA-Z']+ [a-zA-Z']+ [a-zA-Z']+");
assertThat(faker.expression("#{number.number_between '1','10'}")).matches("[1-9](\\.[0-9]+)?");
assertThat(faker.expression("#{number.number_between '1','10'}")).matches("[1-9]([0-9]+)?");
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.

I think this regex can be simplified: [1-9]\\d* @snuyanzin

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.

thanks, done

@asolntsev asolntsev added this to the 2.4.3 milestone Dec 13, 2024
@asolntsev asolntsev added the enhancement New feature or request label Dec 13, 2024
@snuyanzin snuyanzin merged commit bc0339a into datafaker-net:main Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

number_between for integers returns doubles from time to time

4 participants