policy/acl/aclbit_test.go

24 lines
490 B
Go
Raw Normal View History

2022-08-13 08:47:44 +03:00
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)))
}
})
}