18 lines
352 B
Go
18 lines
352 B
Go
|
package replace
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
"internal/replace"
|
||
|
)
|
||
|
|
||
|
func TestBoyerMooreReplace(t *testing.T) {
|
||
|
var corpus string = "abcdefghi012345jklmnopqrst"
|
||
|
var pairs = []string{"012345", "ABCDEF"}
|
||
|
|
||
|
var want string = "abcdefghiABCDEFjklmnopqrst"
|
||
|
got := replace.BoyerMooreReplace(corpus, pairs)
|
||
|
|
||
|
if want != got {
|
||
|
t.Error("Replacement was wrong.")
|
||
|
}
|
||
|
}
|