@@ -2,33 +2,33 @@ import regularExpressionMatching from '../regularExpressionMatching';
2
2
3
3
describe('regularExpressionMatching', () => {
4
4
it('should match regular expressions in a string', () => {
5
- expect(regularExpressionMatching('', '')).toBeTruthy( );
6
- expect(regularExpressionMatching('a', 'a')).toBeTruthy( );
7
- expect(regularExpressionMatching('aa', 'aa')).toBeTruthy( );
8
- expect(regularExpressionMatching('aab', 'aab')).toBeTruthy( );
9
- expect(regularExpressionMatching('aab', 'aa.')).toBeTruthy( );
10
- expect(regularExpressionMatching('aab', '.a.')).toBeTruthy( );
11
- expect(regularExpressionMatching('aab', '...')).toBeTruthy( );
12
- expect(regularExpressionMatching('a', 'a*')).toBeTruthy( );
13
- expect(regularExpressionMatching('aaa', 'a*')).toBeTruthy( );
14
- expect(regularExpressionMatching('aaab', 'a*b')).toBeTruthy( );
15
- expect(regularExpressionMatching('aaabb', 'a*b*')).toBeTruthy( );
16
- expect(regularExpressionMatching('aaabb', 'a*b*c*')).toBeTruthy( );
17
- expect(regularExpressionMatching('', 'a*')).toBeTruthy( );
18
- expect(regularExpressionMatching('xaabyc', 'xa*b.c')).toBeTruthy( );
19
- expect(regularExpressionMatching('aab', 'c*a*b*')).toBeTruthy( );
20
- expect(regularExpressionMatching('mississippi', 'mis*is*.p*.')).toBeTruthy( );
21
- expect(regularExpressionMatching('ab', '.*')).toBeTruthy( );
5
+ expect(regularExpressionMatching('', '')).toBe(true );
6
+ expect(regularExpressionMatching('a', 'a')).toBe(true );
7
+ expect(regularExpressionMatching('aa', 'aa')).toBe(true );
8
+ expect(regularExpressionMatching('aab', 'aab')).toBe(true );
9
+ expect(regularExpressionMatching('aab', 'aa.')).toBe(true );
10
+ expect(regularExpressionMatching('aab', '.a.')).toBe(true );
11
+ expect(regularExpressionMatching('aab', '...')).toBe(true );
12
+ expect(regularExpressionMatching('a', 'a*')).toBe(true );
13
+ expect(regularExpressionMatching('aaa', 'a*')).toBe(true );
14
+ expect(regularExpressionMatching('aaab', 'a*b')).toBe(true );
15
+ expect(regularExpressionMatching('aaabb', 'a*b*')).toBe(true );
16
+ expect(regularExpressionMatching('aaabb', 'a*b*c*')).toBe(true );
17
+ expect(regularExpressionMatching('', 'a*')).toBe(true );
18
+ expect(regularExpressionMatching('xaabyc', 'xa*b.c')).toBe(true );
19
+ expect(regularExpressionMatching('aab', 'c*a*b*')).toBe(true );
20
+ expect(regularExpressionMatching('mississippi', 'mis*is*.p*.')).toBe(true );
21
+ expect(regularExpressionMatching('ab', '.*')).toBe(true );
22
22
23
- expect(regularExpressionMatching('', 'a')).toBeFalsy( );
24
- expect(regularExpressionMatching('a', '')).toBeFalsy( );
25
- expect(regularExpressionMatching('aab', 'aa')).toBeFalsy( );
26
- expect(regularExpressionMatching('aab', 'baa')).toBeFalsy( );
27
- expect(regularExpressionMatching('aabc', '...')).toBeFalsy( );
28
- expect(regularExpressionMatching('aaabbdd', 'a*b*c*')).toBeFalsy( );
29
- expect(regularExpressionMatching('mississippi', 'mis*is*p*.')).toBeFalsy( );
30
- expect(regularExpressionMatching('ab', 'a*')).toBeFalsy( );
31
- expect(regularExpressionMatching('abba', 'a*b*.c')).toBeFalsy( );
32
- expect(regularExpressionMatching('abba', '.*c')).toBeFalsy( );
23
+ expect(regularExpressionMatching('', 'a')).toBe(false );
24
+ expect(regularExpressionMatching('a', '')).toBe(false );
25
+ expect(regularExpressionMatching('aab', 'aa')).toBe(false );
26
+ expect(regularExpressionMatching('aab', 'baa')).toBe(false );
27
+ expect(regularExpressionMatching('aabc', '...')).toBe(false );
28
+ expect(regularExpressionMatching('aaabbdd', 'a*b*c*')).toBe(false );
29
+ expect(regularExpressionMatching('mississippi', 'mis*is*p*.')).toBe(false );
30
+ expect(regularExpressionMatching('ab', 'a*')).toBe(false );
31
+ expect(regularExpressionMatching('abba', 'a*b*.c')).toBe(false );
32
+ expect(regularExpressionMatching('abba', '.*c')).toBe(false );
33
33
});
34
34
});
0 commit comments