commit f36019793d89d7f7fb5d0caa2ae486f03c6ddd39
parent 2f6fedb4b23cea27e74172a1a3718e869bb33478
Author: Matsuda Kenji <info@mtkn.jp>
Date: Mon, 11 Sep 2023 08:32:04 +0900
add tests
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/uid_test.go b/uid_test.go
@@ -27,6 +27,8 @@ func TestHasPerm(t *testing.T) {
want bool
}{
{permFile{0777, "bocchi", "kessoku"}, "bocchi", 04, true},
+ {permFile{0770, "bocchi", "kessoku"}, "nijika", 04, false},
+ {permFile{0000, "bocchi", "kessoku"}, "bocchi", 04, false},
}
for i, test := range tests {
@@ -36,7 +38,7 @@ func TestHasPerm(t *testing.T) {
continue
}
if got != test.want {
- t.Errorf("hasPerm(file[%d], %s, %O) == %t\n",
+ t.Errorf("hasPerm(file[%d], %s, 0%o) == %t\n",
i, test.uid, test.perm, got)
continue
}