summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in/fsnotify.v1/fsnotify_test.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-06-24 11:29:13 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-06-24 13:20:59 +0200
commitd697456dc90adbaf68224ed7c115b38d5855e582 (patch)
tree5fd88c48b34e7bead0028fa97e39f43f03880642 /vendor/gopkg.in/fsnotify.v1/fsnotify_test.go
parenta3211b73c62a9fcc13f09305bf629ef507b26d34 (diff)
downloadpodman-d697456dc90adbaf68224ed7c115b38d5855e582.tar.gz
podman-d697456dc90adbaf68224ed7c115b38d5855e582.tar.bz2
podman-d697456dc90adbaf68224ed7c115b38d5855e582.zip
migrate to go-modules
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/gopkg.in/fsnotify.v1/fsnotify_test.go')
-rw-r--r--vendor/gopkg.in/fsnotify.v1/fsnotify_test.go70
1 files changed, 0 insertions, 70 deletions
diff --git a/vendor/gopkg.in/fsnotify.v1/fsnotify_test.go b/vendor/gopkg.in/fsnotify.v1/fsnotify_test.go
deleted file mode 100644
index f9771d9df..000000000
--- a/vendor/gopkg.in/fsnotify.v1/fsnotify_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !plan9
-
-package fsnotify
-
-import (
- "os"
- "testing"
- "time"
-)
-
-func TestEventStringWithValue(t *testing.T) {
- for opMask, expectedString := range map[Op]string{
- Chmod | Create: `"/usr/someFile": CREATE|CHMOD`,
- Rename: `"/usr/someFile": RENAME`,
- Remove: `"/usr/someFile": REMOVE`,
- Write | Chmod: `"/usr/someFile": WRITE|CHMOD`,
- } {
- event := Event{Name: "/usr/someFile", Op: opMask}
- if event.String() != expectedString {
- t.Fatalf("Expected %s, got: %v", expectedString, event.String())
- }
-
- }
-}
-
-func TestEventOpStringWithValue(t *testing.T) {
- expectedOpString := "WRITE|CHMOD"
- event := Event{Name: "someFile", Op: Write | Chmod}
- if event.Op.String() != expectedOpString {
- t.Fatalf("Expected %s, got: %v", expectedOpString, event.Op.String())
- }
-}
-
-func TestEventOpStringWithNoValue(t *testing.T) {
- expectedOpString := ""
- event := Event{Name: "testFile", Op: 0}
- if event.Op.String() != expectedOpString {
- t.Fatalf("Expected %s, got: %v", expectedOpString, event.Op.String())
- }
-}
-
-// TestWatcherClose tests that the goroutine started by creating the watcher can be
-// signalled to return at any time, even if there is no goroutine listening on the events
-// or errors channels.
-func TestWatcherClose(t *testing.T) {
- t.Parallel()
-
- name := tempMkFile(t, "")
- w := newWatcher(t)
- err := w.Add(name)
- if err != nil {
- t.Fatal(err)
- }
-
- err = os.Remove(name)
- if err != nil {
- t.Fatal(err)
- }
- // Allow the watcher to receive the event.
- time.Sleep(time.Millisecond * 100)
-
- err = w.Close()
- if err != nil {
- t.Fatal(err)
- }
-}