| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
package notify |
| 8 |
|
| 9 |
import ( |
| 10 |
"os" |
| 11 |
"testing" |
| 12 |
) |
| 13 |
|
| 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"}, |
| 21 |
} |
| 22 |
testCanonical(t, cases[:]) |
| 23 |
} |
| 24 |
|
| 25 |
func TestCanonicalDarwinMultiple(t *testing.T) { |
| 26 |
etcsym, err := symlink("/etc", "") |
| 27 |
if err != nil { |
| 28 |
t.Fatal(err) |
| 29 |
} |
| 30 |
tmpsym, err := symlink("/tmp", "") |
| 31 |
if err != nil { |
| 32 |
t.Fatal(nonil(err, os.Remove(etcsym))) |
| 33 |
} |
| 34 |
defer removeall(etcsym, tmpsym) |
| 35 |
cases := [...]caseCanonical{ |
| 36 |
{etcsym, "/private/etc"}, |
| 37 |
{etcsym + "/hosts", "/private/etc/hosts"}, |
| 38 |
{tmpsym, "/private/tmp"}, |
| 39 |
} |
| 40 |
testCanonical(t, cases[:]) |
| 41 |
} |