Skip to content

Commit 5108f9a

Browse files
committed
Add negative normalize tests
1 parent 2c3baf1 commit 5108f9a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ The `normalizePathname` function will return a normalized string for matching wi
177177
const re = pathToRegexp("/caf\u00E9");
178178
const input = encodeURI("/cafe\u0301");
179179

180+
re.test(input); //=> false
180181
re.test(normalizePathname(input)); //=> true
181182
```
182183

src/index.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,6 +2826,7 @@ describe("path-to-regexp", function() {
28262826
const re = pathToRegexp.pathToRegexp("/caf\u00E9");
28272827
const input = encodeURI("/cafe\u0301");
28282828

2829+
expect(exec(re, input)).toEqual(null);
28292830
expect(exec(re, pathToRegexp.normalizePathname(input))).toEqual([
28302831
"/caf\u00E9"
28312832
]);

0 commit comments

Comments
 (0)