Skip to content

Commit e96d78b

Browse files
committed
Fix Naive String Search test
1 parent df3565a commit e96d78b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

NaiveStringSearch/NaiveStringSearch_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package NaiveStringSearch
22

33
import (
4-
"fmt"
54
"math/rand"
65
"testing"
76
"time"
@@ -10,13 +9,12 @@ import (
109
func TestNaiveStringSearch(t *testing.T) {
1110
random := rand.New(rand.NewSource(time.Now().UnixNano()))
1211
letters := []rune("abcdefghijklmnopqrstuvwxyz")
13-
text := make([]rune, random.Intn(15-5)+5)
12+
text := make([]rune, random.Intn(15-10)+10)
1413
for i := range text {
1514
text[i] = letters[rand.Intn(len(letters))]
1615
}
1716
end := random.Intn(len(text)-5) + 5
1817
start := random.Intn(end)
19-
fmt.Println(len(text), end, start)
2018
result := NaiveStringSearch(string(text), string(text[start:end]))
2119
if result == -1 {
2220
t.Fail()

0 commit comments

Comments
 (0)