aboutsummaryrefslogtreecommitdiff
path: root/hotline/access_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hotline/access_test.go')
-rw-r--r--hotline/access_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/hotline/access_test.go b/hotline/access_test.go
new file mode 100644
index 0000000..b262407
--- /dev/null
+++ b/hotline/access_test.go
@@ -0,0 +1,39 @@
+package hotline
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func Test_accessBitmap_IsSet(t *testing.T) {
+ type args struct {
+ i int
+ }
+ tests := []struct {
+ name string
+ bits accessBitmap
+ args args
+ want bool
+ }{
+ {
+ name: "returns true when bit is set",
+ bits: func() (access accessBitmap) {
+ access.Set(22)
+ return access
+ }(),
+ args: args{i: 22},
+ want: true,
+ },
+ {
+ name: "returns false when bit is unset",
+ bits: accessBitmap{},
+ args: args{i: 22},
+ want: false,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ assert.Equalf(t, tt.want, tt.bits.IsSet(tt.args.i), "IsSet(%v)", tt.args.i)
+ })
+ }
+}