mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Test for func TimeIs0h
This commit is contained in:
19
utils/coreutils_test.go
Normal file
19
utils/coreutils_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestTimeIs0h(t *testing.T) {
|
||||
t1, err := time.Parse(time.RFC3339, "2012-11-01T22:08:41+00:00")
|
||||
if err != nil {
|
||||
t.Log(err)
|
||||
t.Errorf("time parsing error")
|
||||
}
|
||||
result := TimeIs0h(t1)
|
||||
if result != false {
|
||||
t.Errorf("time is 0 when it's supposed to be 2012-11-01T22:08:41+00:00")
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user