mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
pkg/stringutil: sort 'ss' in TestUniqueStrings
From the algorithm below, 'ss' should be sorted. Also removes 'fmt.Println', because the idiomatic tests would not print. Signed-off-by: Jes Cok <xigua67damn@gmail.com>
This commit is contained in:
parent
55253cee1b
commit
eef8636f35
@ -15,16 +15,16 @@
|
||||
package stringutil
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestUniqueStrings(t *testing.T) {
|
||||
ss := UniqueStrings(10, 50)
|
||||
sort.Strings(ss)
|
||||
for i := 1; i < len(ss); i++ {
|
||||
if ss[i-1] == ss[i] {
|
||||
t.Fatalf("ss[i-1] %q == ss[i] %q", ss[i-1], ss[i])
|
||||
}
|
||||
}
|
||||
fmt.Println(ss)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user