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

Function Test_countAndSay

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

Source from the content-addressed store, hash-verified

6)
7
8func Test_countAndSay(t *testing.T) {
9 type args struct {
10 n int
11 }
12 tests := []struct {
13 name string
14 args args
15 want string
16 }{
17 {
18 name: "count and say",
19 args: args{
20 n: 1,
21 },
22 want: "1",
23 },
24 {
25 name: "count and say",
26 args: args{
27 n: 2,
28 },
29 want: "11",
30 },
31 {
32 name: "count and say",
33 args: args{
34 n: 3,
35 },
36 want: "21",
37 },
38 {
39 name: "count and say",
40 args: args{
41 n: 4,
42 },
43 want: "1211",
44 },
45 {
46 name: "count and say",
47 args: args{
48 n: 5,
49 },
50 want: "111221",
51 },
52 }
53 for _, tt := range tests {
54 t.Run(tt.name, func(t *testing.T) {
55 assert.Equal(t, tt.want, countAndSay(tt.args.n))
56 })
57 }
58}

Callers

nothing calls this directly

Calls 1

countAndSayFunction · 0.85

Tested by

no test coverage detected