1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
package main import ( "testing" "github.com/stretchr/testify/assert" ) func TestReplaceAll(t *testing.T) { sf := &stringFunc{} assert.Equal(t, "Replaced", sf.replaceAll("Orig", "Replaced", "Orig")) assert.Equal(t, "ReplacedReplaced", sf.replaceAll("Orig", "Replaced", "OrigOrig")) }