1
- // +build !windows
2
-
3
1
package watch
4
2
5
3
import (
@@ -41,6 +39,9 @@ func TestNoWatches(t *testing.T) {
41
39
}
42
40
43
41
func TestEventOrdering (t * testing.T ) {
42
+ if runtime .GOOS == "windows" {
43
+ t .Skip ("Skipping on windows for now" )
44
+ }
44
45
f := newNotifyFixture (t )
45
46
defer f .tearDown ()
46
47
@@ -73,6 +74,9 @@ func TestEventOrdering(t *testing.T) {
73
74
// of directories, creates files in them, then deletes
74
75
// them all quickly. Make sure there are no errors.
75
76
func TestGitBranchSwitch (t * testing.T ) {
77
+ if runtime .GOOS == "windows" {
78
+ t .Skip ("Skipping on windows for now" )
79
+ }
76
80
f := newNotifyFixture (t )
77
81
defer f .tearDown ()
78
82
@@ -143,10 +147,11 @@ func TestWatchesAreRecursive(t *testing.T) {
143
147
f .events = nil
144
148
// change sub directory
145
149
changeFilePath := filepath .Join (subPath , "change" )
146
- _ , err := os .OpenFile (changeFilePath , os .O_RDONLY | os .O_CREATE , 0666 )
150
+ h , err := os .OpenFile (changeFilePath , os .O_RDONLY | os .O_CREATE , 0666 )
147
151
if err != nil {
148
152
t .Fatal (err )
149
153
}
154
+ defer h .Close ()
150
155
151
156
f .assertEvents (changeFilePath )
152
157
}
@@ -168,10 +173,12 @@ func TestNewDirectoriesAreRecursivelyWatched(t *testing.T) {
168
173
169
174
// change something inside sub directory
170
175
changeFilePath := filepath .Join (subPath , "change" )
171
- _ , err := os .OpenFile (changeFilePath , os .O_RDONLY | os .O_CREATE , 0666 )
176
+ h , err := os .OpenFile (changeFilePath , os .O_RDONLY | os .O_CREATE , 0666 )
172
177
if err != nil {
173
178
t .Fatal (err )
174
179
}
180
+ defer h .Close ()
181
+
175
182
f .assertEvents (subPath , changeFilePath )
176
183
}
177
184
@@ -278,6 +285,9 @@ func TestSingleFile(t *testing.T) {
278
285
}
279
286
280
287
func TestWriteBrokenLink (t * testing.T ) {
288
+ if runtime .GOOS == "windows" {
289
+ t .Skip ("Symlink creation requires admin privileges on Windows" )
290
+ }
281
291
f := newNotifyFixture (t )
282
292
defer f .tearDown ()
283
293
@@ -292,6 +302,9 @@ func TestWriteBrokenLink(t *testing.T) {
292
302
}
293
303
294
304
func TestWriteGoodLink (t * testing.T ) {
305
+ if runtime .GOOS == "windows" {
306
+ t .Skip ("Symlink creation requires admin privileges on Windows" )
307
+ }
295
308
f := newNotifyFixture (t )
296
309
defer f .tearDown ()
297
310
@@ -311,6 +324,9 @@ func TestWriteGoodLink(t *testing.T) {
311
324
}
312
325
313
326
func TestWatchBrokenLink (t * testing.T ) {
327
+ if runtime .GOOS == "windows" {
328
+ t .Skip ("Symlink creation requires admin privileges on Windows" )
329
+ }
314
330
f := newNotifyFixture (t )
315
331
defer f .tearDown ()
316
332
@@ -339,6 +355,10 @@ func TestWatchBrokenLink(t *testing.T) {
339
355
}
340
356
341
357
func TestMoveAndReplace (t * testing.T ) {
358
+ if runtime .GOOS == "windows" {
359
+ t .Skip ("Skipping on windows for now" )
360
+ }
361
+
342
362
f := newNotifyFixture (t )
343
363
defer f .tearDown ()
344
364
0 commit comments