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

Function Test_isHappy

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

Source from the content-addressed store, hash-verified

6)
7
8func Test_isHappy(t *testing.T) {
9 type args struct {
10 n int
11 }
12 tests := []struct {
13 name string
14 args args
15 want bool
16 }{
17 {
18 name: "is happy number",
19 args: args{
20 n: 19,
21 },
22 want: true,
23 },
24 {
25 name: "is happy number",
26 args: args{
27 n: 7,
28 },
29 want: true,
30 },
31 {
32 name: "is happy number",
33 args: args{
34 n: 116,
35 },
36 want: false,
37 },
38 }
39 for _, tt := range tests {
40 t.Run(tt.name, func(t *testing.T) {
41 assert.Equal(t, tt.want, isHappy(tt.args.n))
42 })
43 }
44}

Callers

nothing calls this directly

Calls 1

isHappyFunction · 0.85

Tested by

no test coverage detected