mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
match one symbol prefix as well
This commit is contained in:
@@ -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++ {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user