MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Test_countBits

Function Test_countBits

counting_bits_338/solution_test.go:8–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func Test_countBits(t *testing.T) {
9 type args struct {
10 num int
11 }
12 tests := []struct {
13 name string
14 args args
15 want []int
16 }{
17 {
18 name: "counting bits",
19 args: args{
20 num: 2,
21 },
22 want: []int{
23 0, 1, 1,
24 },
25 },
26 {
27 name: "counting bits",
28 args: args{
29 num: 5,
30 },
31 want: []int{
32 0, 1, 1, 2, 1, 2,
33 },
34 },
35 }
36 for _, tt := range tests {
37 t.Run(tt.name, func(t *testing.T) {
38 assert.Equal(t, tt.want, countBits(tt.args.num))
39 })
40 }
41}

Callers

nothing calls this directly

Calls 1

countBitsFunction · 0.85

Tested by

no test coverage detected