Skip to content

Commit acb48f1

Browse files
authored
More directory patterns for testing that we will care about (#53653)
1 parent 3f7a8d5 commit acb48f1

File tree

29 files changed

+50293
-7
lines changed

29 files changed

+50293
-7
lines changed

src/testRunner/unittests/canWatch.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,10 @@ describe("unittests:: canWatch::", () => {
155155
const paths: ts.Path[] = [];
156156
let longestPathLength = 0;
157157
getPathsOfDifferentFoldersAt(osRoot as ts.Path);
158-
osRoot = ts.ensureTrailingDirectorySeparator(osRoot);
159-
const users = combinePaths(osRoot, "users");
160-
paths.push(users);
161-
getPathsOfDifferentFoldersAt(combinePaths(users, "username"));
162-
const user = combinePaths(osRoot, "user");
163-
paths.push(user);
164-
getPathsOfDifferentFoldersAt(combinePaths(user, "username"));
158+
getPathsOfDifferentFoldersWithUsers("users");
159+
getPathsOfDifferentFoldersWithUsers("user");
160+
getPathsOfDifferentFoldersWithUsers("usr");
161+
getPathsOfDifferentFoldersWithUsers("home");
165162
baselineOsRoot(paths, longestPathLength, baseline);
166163
Baseline.runBaseline(`canWatch/${scenario}${suffix}.baseline.md`, baseline.join("\r\n"));
167164
function getPathsOfDifferentFoldersAt(root: ts.Path) {
@@ -174,6 +171,11 @@ describe("unittests:: canWatch::", () => {
174171
}
175172
longestPathLength = Math.max(ts.last(paths).length, longestPathLength);
176173
}
174+
function getPathsOfDifferentFoldersWithUsers(usersType: string) {
175+
const users = combinePaths(osRoot, usersType);
176+
paths.push(users);
177+
getPathsOfDifferentFoldersAt(combinePaths(users, "username"));
178+
}
177179
}
178180

179181
function combinePaths(path: string, addition: string, anotherAddition?: string): ts.Path {

tests/baselines/reference/canWatch/canWatchAffectingLocationDos.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchAffectingLocationPosix.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchAffectingLocationUnc.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchAffectingLocationUncDos.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchAtTypesDos.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchAtTypesPosix.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchAtTypesUnc.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchAtTypesUncDos.baseline.md

Lines changed: 1120 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/canWatch/canWatchDirectoryOrFileDos.baseline.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ Determines if given directory or file can be watched
2929
| c:/user/username/folderAtRoot/folder1/folder2/folder3 | true |
3030
| c:/user/username/folderAtRoot/folder1/folder2/folder3/folder4 | true |
3131
| c:/user/username/folderAtRoot/folder1/folder2/folder3/folder4/folder5 | true |
32+
| c:/usr | false |
33+
| c:/usr/username | true |
34+
| c:/usr/username/folderAtRoot | true |
35+
| c:/usr/username/folderAtRoot/folder1 | true |
36+
| c:/usr/username/folderAtRoot/folder1/folder2 | true |
37+
| c:/usr/username/folderAtRoot/folder1/folder2/folder3 | true |
38+
| c:/usr/username/folderAtRoot/folder1/folder2/folder3/folder4 | true |
39+
| c:/usr/username/folderAtRoot/folder1/folder2/folder3/folder4/folder5 | true |
40+
| c:/home | false |
41+
| c:/home/username | true |
42+
| c:/home/username/folderAtRoot | true |
43+
| c:/home/username/folderAtRoot/folder1 | true |
44+
| c:/home/username/folderAtRoot/folder1/folder2 | true |
45+
| c:/home/username/folderAtRoot/folder1/folder2/folder3 | true |
46+
| c:/home/username/folderAtRoot/folder1/folder2/folder3/folder4 | true |
47+
| c:/home/username/folderAtRoot/folder1/folder2/folder3/folder4/folder5 | true |
3248

3349
| File | canWatchDirectoryOrFile |
3450
| ----------------------------------------------------------------------------------- | ----------------------- |
@@ -55,4 +71,20 @@ Determines if given directory or file can be watched
5571
| c:/user/username/folderAtRoot/folder1/folder2/folder3/package.json | true |
5672
| c:/user/username/folderAtRoot/folder1/folder2/folder3/folder4/package.json | true |
5773
| c:/user/username/folderAtRoot/folder1/folder2/folder3/folder4/folder5/package.json | true |
74+
| c:/usr/package.json | true |
75+
| c:/usr/username/package.json | true |
76+
| c:/usr/username/folderAtRoot/package.json | true |
77+
| c:/usr/username/folderAtRoot/folder1/package.json | true |
78+
| c:/usr/username/folderAtRoot/folder1/folder2/package.json | true |
79+
| c:/usr/username/folderAtRoot/folder1/folder2/folder3/package.json | true |
80+
| c:/usr/username/folderAtRoot/folder1/folder2/folder3/folder4/package.json | true |
81+
| c:/usr/username/folderAtRoot/folder1/folder2/folder3/folder4/folder5/package.json | true |
82+
| c:/home/package.json | true |
83+
| c:/home/username/package.json | true |
84+
| c:/home/username/folderAtRoot/package.json | true |
85+
| c:/home/username/folderAtRoot/folder1/package.json | true |
86+
| c:/home/username/folderAtRoot/folder1/folder2/package.json | true |
87+
| c:/home/username/folderAtRoot/folder1/folder2/folder3/package.json | true |
88+
| c:/home/username/folderAtRoot/folder1/folder2/folder3/folder4/package.json | true |
89+
| c:/home/username/folderAtRoot/folder1/folder2/folder3/folder4/folder5/package.json | true |
5890

0 commit comments

Comments
 (0)