Apply eslint auto-fix formatting to windows-path-matching test
Co-authored-by: salmanmkc <[email protected]>
This commit is contained in:
co-authored by
salmanmkc
parent
f4d818c7a2
commit
1cd929181f
@@ -17,10 +17,10 @@ describe('Windows path matching', () => {
|
|||||||
|
|
||||||
// Test basic pattern matching with Windows paths
|
// Test basic pattern matching with Windows paths
|
||||||
const pattern = new Pattern('C:\\Users\\test\\*')
|
const pattern = new Pattern('C:\\Users\\test\\*')
|
||||||
|
|
||||||
// The itemPath would come from fs.readdir with backslashes on Windows
|
// The itemPath would come from fs.readdir with backslashes on Windows
|
||||||
const itemPath = 'C:\\Users\\test\\file.txt'
|
const itemPath = 'C:\\Users\\test\\file.txt'
|
||||||
|
|
||||||
// This should match because the pattern and path both refer to the same file
|
// This should match because the pattern and path both refer to the same file
|
||||||
expect(pattern.match(itemPath)).toBe(MatchKind.All)
|
expect(pattern.match(itemPath)).toBe(MatchKind.All)
|
||||||
})
|
})
|
||||||
@@ -32,7 +32,7 @@ describe('Windows path matching', () => {
|
|||||||
|
|
||||||
// Test partial matching with Windows paths
|
// Test partial matching with Windows paths
|
||||||
const pattern = new Pattern('C:\\Users\\test\\**')
|
const pattern = new Pattern('C:\\Users\\test\\**')
|
||||||
|
|
||||||
// Should partially match parent directory
|
// Should partially match parent directory
|
||||||
expect(pattern.partialMatch('C:\\Users')).toBe(true)
|
expect(pattern.partialMatch('C:\\Users')).toBe(true)
|
||||||
expect(pattern.partialMatch('C:\\Users\\test')).toBe(true)
|
expect(pattern.partialMatch('C:\\Users\\test')).toBe(true)
|
||||||
@@ -44,7 +44,7 @@ describe('Windows path matching', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pattern = new Pattern('C:\\foo\\**')
|
const pattern = new Pattern('C:\\foo\\**')
|
||||||
|
|
||||||
// Should match the directory itself and descendants
|
// Should match the directory itself and descendants
|
||||||
expect(pattern.match('C:\\foo')).toBe(MatchKind.All)
|
expect(pattern.match('C:\\foo')).toBe(MatchKind.All)
|
||||||
expect(pattern.match('C:\\foo\\bar')).toBe(MatchKind.All)
|
expect(pattern.match('C:\\foo\\bar')).toBe(MatchKind.All)
|
||||||
@@ -58,7 +58,7 @@ describe('Windows path matching', () => {
|
|||||||
|
|
||||||
// Pattern might be specified with forward slashes by user
|
// Pattern might be specified with forward slashes by user
|
||||||
const pattern = new Pattern('C:/Users/*/file.txt')
|
const pattern = new Pattern('C:/Users/*/file.txt')
|
||||||
|
|
||||||
// But the actual path from filesystem will have backslashes
|
// But the actual path from filesystem will have backslashes
|
||||||
expect(pattern.match('C:\\Users\\test\\file.txt')).toBe(MatchKind.All)
|
expect(pattern.match('C:\\Users\\test\\file.txt')).toBe(MatchKind.All)
|
||||||
})
|
})
|
||||||
@@ -70,10 +70,14 @@ describe('Windows path matching', () => {
|
|||||||
|
|
||||||
const currentDrive = process.cwd().substring(0, 2)
|
const currentDrive = process.cwd().substring(0, 2)
|
||||||
const pattern = new Pattern(`${currentDrive}\\**\\*.txt`)
|
const pattern = new Pattern(`${currentDrive}\\**\\*.txt`)
|
||||||
|
|
||||||
// Should match .txt files at any depth
|
// Should match .txt files at any depth
|
||||||
expect(pattern.match(`${currentDrive}\\file.txt`)).toBe(MatchKind.All)
|
expect(pattern.match(`${currentDrive}\\file.txt`)).toBe(MatchKind.All)
|
||||||
expect(pattern.match(`${currentDrive}\\foo\\bar\\test.txt`)).toBe(MatchKind.All)
|
expect(pattern.match(`${currentDrive}\\foo\\bar\\test.txt`)).toBe(
|
||||||
expect(pattern.match(`${currentDrive}\\foo\\bar\\test.js`)).toBe(MatchKind.None)
|
MatchKind.All
|
||||||
|
)
|
||||||
|
expect(pattern.match(`${currentDrive}\\foo\\bar\\test.js`)).toBe(
|
||||||
|
MatchKind.None
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user