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

Function Test_fizzBuzz

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

Source from the content-addressed store, hash-verified

6)
7
8func Test_fizzBuzz(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: "fizz buzz",
19 args: args{
20 n: 15,
21 },
22 want: []string{
23 "1",
24 "2",
25 "Fizz",
26 "4",
27 "Buzz",
28 "Fizz",
29 "7",
30 "8",
31 "Fizz",
32 "Buzz",
33 "11",
34 "Fizz",
35 "13",
36 "14",
37 "FizzBuzz",
38 },
39 },
40 }
41 for _, tt := range tests {
42 t.Run(tt.name, func(t *testing.T) {
43 assert.Equal(t, tt.want, fizzBuzz(tt.args.n))
44 })
45 }
46}

Callers

nothing calls this directly

Calls 1

fizzBuzzFunction · 0.85

Tested by

no test coverage detected