Skip to content

feat: characterClass & characterRange #29

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

Merged
merged 3 commits into from
Dec 22, 2023
Merged

Conversation

mdjastrzebski
Copy link
Member

@mdjastrzebski mdjastrzebski commented Dec 19, 2023

Summary

test('"characterRange" base cases', () => {
  expect(buildPattern(characterRange('a', 'z'))).toBe('[a-z]');
  expect(buildPattern('x', characterRange('0', '9'))).toBe('x[0-9]');
  expect(buildPattern(characterRange('A', 'F'), 'x')).toBe('[A-F]x');
});

test('"characterClass" base cases', () => {
  expect(
    buildPattern(
      characterClass(characterRange('a', 'z'), characterRange('A', 'Z'))
    )
  ).toBe('[a-zA-Z]');
  expect(
    buildPattern(
       characterClass(characterRange('a', 'z'), anyOf('05')) 
    )
  ).toBe('[a-z05]');
  expect(
    buildPattern(
      characterClass(characterRange('a', 'z'), whitespace)
    )
  ).toBe('[a-z\\s]');
});```

### Test plan

Added tests.

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f620c06) 100.00% compared to head (88139c2) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          127       142   +15     
  Branches        32        36    +4     
=========================================
+ Hits           127       142   +15     

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

@mdjastrzebski mdjastrzebski changed the title feat: characterClass (including character ranges) feat: characterClass & characterRange Dec 21, 2023
@mdjastrzebski mdjastrzebski merged commit e23d0d6 into main Dec 22, 2023
@mdjastrzebski mdjastrzebski deleted the feat/character-class branch December 22, 2023 13:24
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