Skip to content

Commit 4b110b3

Browse files
committed
Change test pkg
1 parent a0017e5 commit 4b110b3

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

coderd/authz/permission_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
package authz
1+
package authz_test
22

33
import (
4-
crand "github.com/coder/coder/cryptorand"
54
"testing"
5+
6+
"github.com/coder/coder/coderd/authz"
7+
crand "github.com/coder/coder/cryptorand"
68
)
79

810
func BenchmarkPermissionString(b *testing.B) {
911
total := 10000
1012
if b.N < total {
1113
total = b.N
1214
}
13-
perms := make([]Permission, b.N)
15+
perms := make([]authz.Permission, b.N)
1416
for n := 0; n < total; n++ {
1517
perms[n] = RandomPermission()
1618
}
@@ -30,13 +32,13 @@ var actions = []string{
3032
"read", "create", "delete", "modify", "*",
3133
}
3234

33-
func RandomPermission() Permission {
34-
n, _ := crand.Intn(len(PermissionLevels))
35+
func RandomPermission() authz.Permission {
36+
n, _ := crand.Intn(len(authz.PermissionLevels))
3537
m, _ := crand.Intn(len(resourceTypes))
3638
a, _ := crand.Intn(len(actions))
37-
return Permission{
39+
return authz.Permission{
3840
Sign: n%2 == 0,
39-
Level: PermissionLevels[n],
41+
Level: authz.PermissionLevels[n],
4042
ResourceType: resourceTypes[m],
4143
ResourceID: "*",
4244
Action: actions[a],

0 commit comments

Comments
 (0)