feat: add Repeate function for slice

This commit is contained in:
dudaodong committed 2022-11-27 21:43:38 +08:00
1 parent ab6fec2f69
commit a87faf5453
2 files changed
+17

No files matched your search

+8
View File
@@ -684,3 +684,11 @@ func TestKeyBy(t *testing.T) {
assert.Equal(result, map[int]string{1: "a", 2: "ab", 3: "abc"})
}
func TestRepeat(t *testing.T) {
assert := internal.NewAssert(t, "TestRepeat")
result := Repeat("a", 6)
assert.Equal(result, []string{"a", "a", "a", "a", "a", "a"})
}