mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Removed unused functions and tests in utils
This commit is contained in:
committed by
Dan Christian Bogos
parent
ae1eeb35ab
commit
ae76b8af50
@@ -852,51 +852,6 @@ func TestFmtFieldWidth(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCastIfToString(t *testing.T) {
|
||||
v := interface{}("somestr")
|
||||
if sOut, casts := CastIfToString(v); !casts {
|
||||
t.Error("Does not cast")
|
||||
} else if sOut != "somestr" {
|
||||
t.Errorf("Received: %+v", sOut)
|
||||
}
|
||||
v = interface{}(1)
|
||||
if sOut, casts := CastIfToString(v); !casts {
|
||||
t.Error("Does not cast")
|
||||
} else if sOut != "1" {
|
||||
t.Errorf("Received: %+v", sOut)
|
||||
}
|
||||
v = interface{}((int64)(1))
|
||||
if sOut, casts := CastIfToString(v); !casts {
|
||||
t.Error("Does not cast")
|
||||
} else if sOut != "1" {
|
||||
t.Errorf("Received: %+v", sOut)
|
||||
}
|
||||
v = interface{}(true)
|
||||
if sOut, casts := CastIfToString(v); !casts {
|
||||
t.Error("Does not cast")
|
||||
} else if sOut != "true" {
|
||||
t.Errorf("Received: %+v", sOut)
|
||||
}
|
||||
v = interface{}([]byte("test"))
|
||||
if sOut, casts := CastIfToString(v); !casts {
|
||||
t.Error("Does not cast")
|
||||
} else if sOut != "test" {
|
||||
t.Errorf("Received: %+v", sOut)
|
||||
}
|
||||
v = interface{}(1.2)
|
||||
if sOut, casts := CastIfToString(v); !casts {
|
||||
t.Error("Does not cast")
|
||||
} else if sOut != "1.2" {
|
||||
t.Errorf("Received: %+v", sOut)
|
||||
}
|
||||
//default
|
||||
v = interface{}([]string{"test"})
|
||||
if _, casts := CastIfToString(v); casts {
|
||||
t.Error("Does cast")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestEndOfMonth(t *testing.T) {
|
||||
eom := GetEndOfMonth(time.Date(2016, time.February, 5, 10, 1, 2, 3, time.UTC))
|
||||
expected := time.Date(2016, time.February, 29, 23, 59, 59, 0, time.UTC)
|
||||
@@ -1197,12 +1152,6 @@ func TestLess(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCapitalizedMessage(t *testing.T) {
|
||||
if capMsg := CapitalizedMessage(ServiceAlreadyRunning); capMsg != "SERVICE_ALREADY_RUNNING" {
|
||||
t.Errorf("Received: <%s>", capMsg)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetCGRVersion(t *testing.T) {
|
||||
GitLastLog = `commit 73014daa0c1d7edcb532d5fe600b8a20d588cdf8
|
||||
Author: DanB <danb@cgrates.org>
|
||||
|
||||
Reference in New Issue
Block a user