|
1
|
import { isPathInsideOrEqual } from "../util/filename" |
|
2
|
|
|
3
|
describe("filename utilities", () => { |
|
4
|
it("compares paths after normalizing separators", () => { |
|
5
|
expect( |
|
6
|
isPathInsideOrEqual( |
|
7
|
"C:\\repo\\src\\modules\\company\\models\\office.ts", |
|
8
|
"C:\\repo\\src\\modules\\company" |
|
9
|
) |
|
10
|
).toBe(true) |
|
11
|
}) |
|
12
|
|
|
13
|
it("does not match sibling paths with the same prefix", () => { |
|
14
|
expect( |
|
15
|
isPathInsideOrEqual( |
|
16
|
"/repo/src/modules/company-old", |
|
17
|
"/repo/src/modules/company" |
|
18
|
) |
|
19
|
).toBe(false) |
|
20
|
}) |
|
21
|
}) |