policy/acl/aclbit_test.go
Anatoly Prohacky 781b198f8c change v0.0.2
2023-03-04 17:30:21 +10:00

24 lines
480 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, a.Verify(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, a.Verify(acl.NumBit(i)))
}
})
}