MCPcopy Index your code
hub / github.com/fluid-cloudnative/fluid / TestFillSliceWithString

Function TestFillSliceWithString

pkg/utils/slice_test.go:24–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func TestFillSliceWithString(t *testing.T) {
25 type args struct {
26 str string
27 num int
28 }
29 tests := []struct {
30 name string
31 args args
32 want *[]string
33 }{
34 {
35 name: "Fill Slice Test1",
36 args: args{
37 str: "foo",
38 num: 3,
39 },
40 want: &[]string{"foo", "foo", "foo"},
41 },
42 {
43 name: "Fill Slice Test2",
44 args: args{
45 str: "bar",
46 num: 0,
47 },
48 want: &[]string{},
49 },
50 }
51 for _, tt := range tests {
52 t.Run(tt.name, func(t *testing.T) {
53 if got := FillSliceWithString(tt.args.str, tt.args.num); !reflect.DeepEqual(got, tt.want) {
54 t.Errorf("FillSliceWithString() = %v, want %v", got, tt.want)
55 }
56 })
57 }
58}
59
60func TestSubtractString(t *testing.T) {
61 testcases := map[string]struct {

Callers

nothing calls this directly

Calls 1

FillSliceWithStringFunction · 0.85

Tested by

no test coverage detected