match one symbol prefix as well

This commit is contained in:
Radu Ioan Fericean
2014-01-31 17:05:05 +02:00
parent 4032274748
commit 0b7f315d49
2 changed files with 2 additions and 2 deletions

View File

@@ -160,7 +160,7 @@ func RoundTo(whole, amount time.Duration) time.Duration {
}
func SplitPrefix(prefix string) []string {
length := int(math.Max(float64(len(prefix)-1), 0))
length := int(math.Max(float64(len(prefix)), 0))
subs := make([]string, length)
max := len(prefix)
for i := 0; i < length; i++ {

View File

@@ -295,7 +295,7 @@ func TestRound(t *testing.T) {
func TestSplitPrefix(t *testing.T) {
a := SplitPrefix("0123456789")
if len(a) != 9 {
if len(a) != 10 {
t.Error("Error splitting prefix: ", a)
}
}