]> git.r.bdr.sh - rbdr/mobius/blob - hotline/access_test.go
Minor cleanup
[rbdr/mobius] / hotline / access_test.go
1 package hotline
2
3 import (
4 "github.com/stretchr/testify/assert"
5 "testing"
6 )
7
8 func Test_accessBitmap_IsSet(t *testing.T) {
9 type args struct {
10 i int
11 }
12 tests := []struct {
13 name string
14 bits accessBitmap
15 args args
16 want bool
17 }{
18 {
19 name: "returns true when bit is set",
20 bits: func() (access accessBitmap) {
21 access.Set(22)
22 return access
23 }(),
24 args: args{i: 22},
25 want: true,
26 },
27 {
28 name: "returns false when bit is unset",
29 bits: accessBitmap{},
30 args: args{i: 22},
31 want: false,
32 },
33 }
34 for _, tt := range tests {
35 t.Run(tt.name, func(t *testing.T) {
36 assert.Equalf(t, tt.want, tt.bits.IsSet(tt.args.i), "IsSet(%v)", tt.args.i)
37 })
38 }
39 }