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.
14 func TestCanonicalDarwin(t *testing.T) {
15 cases := [...]caseCanonical{
16 {"/etc", "/private/etc"},
17 {"/etc/defaults", "/private/etc/defaults"},
18 {"/etc/hosts", "/private/etc/hosts"},
19 {"/tmp", "/private/tmp"},
20 {"/var", "/private/var"},
22 testCanonical(t, cases[:])
25 func TestCanonicalDarwinMultiple(t *testing.T) {
26 etcsym, err := symlink("/etc", "")
30 tmpsym, err := symlink("/tmp", "")
32 t.Fatal(nonil(err, os.Remove(etcsym)))
34 defer removeall(etcsym, tmpsym)
35 cases := [...]caseCanonical{
36 {etcsym, "/private/etc"},
37 {etcsym + "/hosts", "/private/etc/hosts"},
38 {tmpsym, "/private/tmp"},
40 testCanonical(t, cases[:])