(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func 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 | } |
nothing calls this directly
no test coverage detected