policy/acl/aclbit_test.go
Anatoly Prohacky a84816087c Test acl
2022-08-13 15:47:44 +10:00

24 lines
490 B
Go

package acl_test
import (
"testing"
"github.com/stretchr/testify/assert"
"gitstore.ru/tolikproh/policy/acl"
)
func Test_Acl(t *testing.T) {
t.Run("Valid AclBits", func(t *testing.T) {
for i := 0; i < 63; i++ {
a := acl.New(acl.NumBit(i))
assert.Equal(t, true, acl.Verify(a, acl.NumBit(i)))
}
})
t.Run("NotValid AclBits", func(t *testing.T) {
for i := -63; i == 0; i++ {
a := acl.New(acl.NumBit(i))
assert.NotEqual(t, true, acl.Verify(a, acl.NumBit(i)))
}
})
}