Skip to content

Commit

Permalink
add test when s is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sho0126hiro committed Feb 19, 2023
1 parent 272355d commit 6bdf150
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/pkg/slice/string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ func TestSplitStringSliceInChunks(t *testing.T) {
{"a", "b", "c", "d"},
},
},
{
name: "OK: s is empty and chunkSize is 0",
args: args{
s: []string{},
chunkSize: 0,
},
want: [][]string{{}},
},
{
name: "OK: s is empty and chunkSize is more than 0",
args: args{
s: []string{},
chunkSize: 1,
},
want: [][]string{{}},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 6bdf150

Please sign in to comment.