iteration: add example for Repeat function
This commit is contained in:
parent
de5d9f39b6
commit
2684521bdd
@ -1,6 +1,15 @@
|
|||||||
package iteration
|
package iteration
|
||||||
|
|
||||||
import "testing"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ExampleRepeat() {
|
||||||
|
repeated := Repeat("ab")
|
||||||
|
fmt.Println(repeated)
|
||||||
|
// Output: ababababab
|
||||||
|
}
|
||||||
|
|
||||||
func TestRepeat(t *testing.T) {
|
func TestRepeat(t *testing.T) {
|
||||||
repeated := Repeat("a")
|
repeated := Repeat("a")
|
||||||
|
Loading…
Reference in New Issue
Block a user