@@ -74,6 +74,43 @@ public void TestWatcher()
74
74
Assert . True ( gotChange ) ;
75
75
}
76
76
77
+ [ SkippableTheory ]
78
+ [ InlineData ( "/test" , "/test" , "/foo.txt" ) ]
79
+ [ InlineData ( "/test" , "/test" , "/~foo.txt" ) ]
80
+ [ InlineData ( "/test" , "/TEST" , "/foo.txt" ) ]
81
+ [ InlineData ( "/test" , "/TEST" , "/~foo.txt" ) ]
82
+ [ InlineData ( "/verylongname" , "/VERYLONGNAME" , "/foo.txt" ) ]
83
+ [ InlineData ( "/verylongname" , "/VERYLONGNAME" , "/~foo.txt" ) ]
84
+ public void TestWatcherCaseSensitive ( string physicalDir , string subDir , string filePath )
85
+ {
86
+ Skip . IfNot ( IsWindows , "This test involves case insensitivity on Windows" ) ;
87
+
88
+ var physicalFs = GetCommonPhysicalFileSystem ( ) ;
89
+ physicalFs . CreateDirectory ( physicalDir ) ;
90
+
91
+ Assert . True ( physicalFs . DirectoryExists ( physicalDir ) ) ;
92
+ Assert . True ( physicalFs . DirectoryExists ( subDir ) ) ;
93
+
94
+ var subFs = new SubFileSystem ( physicalFs , subDir ) ;
95
+ var watcher = subFs . Watch ( "/" ) ;
96
+ var waitHandle = new ManualResetEvent ( false ) ;
97
+
98
+ watcher . Created += ( sender , args ) =>
99
+ {
100
+ if ( args . FullPath == filePath )
101
+ {
102
+ waitHandle . Set ( ) ;
103
+ }
104
+ } ;
105
+
106
+ watcher . IncludeSubdirectories = true ;
107
+ watcher . EnableRaisingEvents = true ;
108
+
109
+ physicalFs . WriteAllText ( $ "{ physicalDir } { filePath } ", "test" ) ;
110
+
111
+ Assert . True ( waitHandle . WaitOne ( 100 ) ) ;
112
+ }
113
+
77
114
[ SkippableFact ]
78
115
public void TestDirectorySymlink ( )
79
116
{
0 commit comments