replace zxq.co/ripple/hanayo
This commit is contained in:
33
vendor/github.com/rjeczalik/notify/event_test.go
generated
vendored
Normal file
33
vendor/github.com/rjeczalik/notify/event_test.go
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2014-2015 The Notify Authors. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
package notify
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// S is a workaround for random event strings concatenation order.
|
||||
func s(s string) string {
|
||||
z := strings.Split(s, "|")
|
||||
sort.StringSlice(z).Sort()
|
||||
return strings.Join(z, "|")
|
||||
}
|
||||
|
||||
// This test is not safe to run in parallel with others.
|
||||
func TestEventString(t *testing.T) {
|
||||
cases := map[Event]string{
|
||||
Create: "notify.Create",
|
||||
Create | Remove: "notify.Create|notify.Remove",
|
||||
Create | Remove | Write: "notify.Create|notify.Remove|notify.Write",
|
||||
Create | Write | Rename: "notify.Create|notify.Rename|notify.Write",
|
||||
}
|
||||
for e, str := range cases {
|
||||
if s := s(e.String()); s != str {
|
||||
t.Errorf("want s=%s; got %s (e=%#x)", str, s, e)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user