1 // Copyright (c) 2014-2015 The Notify Authors. All rights reserved.
2 // Use of this source code is governed by the MIT license that can be
3 // found in the LICENSE file.
13 // S is a workaround for random event strings concatenation order.
14 func s(s string) string {
15 z := strings.Split(s, "|")
16 sort.StringSlice(z).Sort()
17 return strings.Join(z, "|")
20 // This test is not safe to run in parallel with others.
21 func TestEventString(t *testing.T) {
22 cases := map[Event]string{
23 Create: "notify.Create",
24 Create | Remove: "notify.Create|notify.Remove",
25 Create | Remove | Write: "notify.Create|notify.Remove|notify.Write",
26 Create | Write | Rename: "notify.Create|notify.Rename|notify.Write",
28 for e, str := range cases {
29 if s := s(e.String()); s != str {
30 t.Errorf("want s=%s; got %s (e=%#x)", str, s, e)