Skip to content

Commit

Permalink
improve test for faker.expression
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed Nov 1, 2024
1 parent 583e81d commit 87a3803
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/java/net/datafaker/FakerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ void badExpressionCouldntCoerce() {
@Test
void expression() {
assertThat(faker.expression("#{options.option 'a','b','c','d'}")).matches("([abcd])");
assertThat(faker.expression("#{options.option ''''}")).matches("(')");
assertThat(faker.expression("#{options.option 'single'}")).isEqualTo("single");
assertThat(faker.expression("#{options.option ''''}")).isEqualTo("'");
assertThat(faker.expression("#{options.option '12','345','89','54321'}")).matches("(12|345|89|54321)");
assertThat(faker.expression("#{regexify '(a|b){2,3}'}")).matches("([ab]){2,3}");
assertThat(faker.expression("#{regexify '\\.\\*\\?\\+'}")).matches("\\.\\*\\?\\+");
Expand Down

0 comments on commit 87a3803

Please sign in to comment.