|
@@ -1,3 +1,5 @@
|
|
|
|
|
+// +build !windows
|
|
|
|
|
+
|
|
|
package watch
|
|
package watch
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
@@ -39,9 +41,6 @@ func TestNoWatches(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func TestEventOrdering(t *testing.T) {
|
|
func TestEventOrdering(t *testing.T) {
|
|
|
- if runtime.GOOS == "windows" {
|
|
|
|
|
- t.Skip("Skipping on windows for now")
|
|
|
|
|
- }
|
|
|
|
|
f := newNotifyFixture(t)
|
|
f := newNotifyFixture(t)
|
|
|
defer f.tearDown()
|
|
defer f.tearDown()
|
|
|
|
|
|
|
@@ -74,9 +73,6 @@ func TestEventOrdering(t *testing.T) {
|
|
|
// of directories, creates files in them, then deletes
|
|
// of directories, creates files in them, then deletes
|
|
|
// them all quickly. Make sure there are no errors.
|
|
// them all quickly. Make sure there are no errors.
|
|
|
func TestGitBranchSwitch(t *testing.T) {
|
|
func TestGitBranchSwitch(t *testing.T) {
|
|
|
- if runtime.GOOS == "windows" {
|
|
|
|
|
- t.Skip("Skipping on windows for now")
|
|
|
|
|
- }
|
|
|
|
|
f := newNotifyFixture(t)
|
|
f := newNotifyFixture(t)
|
|
|
defer f.tearDown()
|
|
defer f.tearDown()
|
|
|
|
|
|
|
@@ -147,11 +143,10 @@ func TestWatchesAreRecursive(t *testing.T) {
|
|
|
f.events = nil
|
|
f.events = nil
|
|
|
// change sub directory
|
|
// change sub directory
|
|
|
changeFilePath := filepath.Join(subPath, "change")
|
|
changeFilePath := filepath.Join(subPath, "change")
|
|
|
- h, err := os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0666)
|
|
|
|
|
|
|
+ _, err := os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0666)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
t.Fatal(err)
|
|
|
}
|
|
}
|
|
|
- defer h.Close()
|
|
|
|
|
|
|
|
|
|
f.assertEvents(changeFilePath)
|
|
f.assertEvents(changeFilePath)
|
|
|
}
|
|
}
|
|
@@ -173,12 +168,10 @@ func TestNewDirectoriesAreRecursivelyWatched(t *testing.T) {
|
|
|
|
|
|
|
|
// change something inside sub directory
|
|
// change something inside sub directory
|
|
|
changeFilePath := filepath.Join(subPath, "change")
|
|
changeFilePath := filepath.Join(subPath, "change")
|
|
|
- h, err := os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0666)
|
|
|
|
|
|
|
+ _, err := os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0666)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
t.Fatal(err)
|
|
|
}
|
|
}
|
|
|
- defer h.Close()
|
|
|
|
|
-
|
|
|
|
|
f.assertEvents(subPath, changeFilePath)
|
|
f.assertEvents(subPath, changeFilePath)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -285,9 +278,6 @@ func TestSingleFile(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func TestWriteBrokenLink(t *testing.T) {
|
|
func TestWriteBrokenLink(t *testing.T) {
|
|
|
- if runtime.GOOS == "windows" {
|
|
|
|
|
- t.Skip("Symlink creation requires admin privileges on Windows")
|
|
|
|
|
- }
|
|
|
|
|
f := newNotifyFixture(t)
|
|
f := newNotifyFixture(t)
|
|
|
defer f.tearDown()
|
|
defer f.tearDown()
|
|
|
|
|
|
|
@@ -302,9 +292,6 @@ func TestWriteBrokenLink(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func TestWriteGoodLink(t *testing.T) {
|
|
func TestWriteGoodLink(t *testing.T) {
|
|
|
- if runtime.GOOS == "windows" {
|
|
|
|
|
- t.Skip("Symlink creation requires admin privileges on Windows")
|
|
|
|
|
- }
|
|
|
|
|
f := newNotifyFixture(t)
|
|
f := newNotifyFixture(t)
|
|
|
defer f.tearDown()
|
|
defer f.tearDown()
|
|
|
|
|
|
|
@@ -324,9 +311,6 @@ func TestWriteGoodLink(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func TestWatchBrokenLink(t *testing.T) {
|
|
func TestWatchBrokenLink(t *testing.T) {
|
|
|
- if runtime.GOOS == "windows" {
|
|
|
|
|
- t.Skip("Symlink creation requires admin privileges on Windows")
|
|
|
|
|
- }
|
|
|
|
|
f := newNotifyFixture(t)
|
|
f := newNotifyFixture(t)
|
|
|
defer f.tearDown()
|
|
defer f.tearDown()
|
|
|
|
|
|
|
@@ -355,10 +339,6 @@ func TestWatchBrokenLink(t *testing.T) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func TestMoveAndReplace(t *testing.T) {
|
|
func TestMoveAndReplace(t *testing.T) {
|
|
|
- if runtime.GOOS == "windows" {
|
|
|
|
|
- t.Skip("Skipping on windows for now")
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
f := newNotifyFixture(t)
|
|
f := newNotifyFixture(t)
|
|
|
defer f.tearDown()
|
|
defer f.tearDown()
|
|
|
|
|
|