Merge pull request #577 from Edwardro22/master

Test for func TimeIs0h
This commit is contained in:
Dan Christian Bogos
2016-10-27 18:12:00 +02:00
committed by GitHub
2 changed files with 20 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ information, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
| @brendangilmore | Brendan Gilmore |
| @afone-lboue | Ludovic Boué |
| @shaneneuerburg | Shane Neuerburg |
| @Edwardro22 | Eduard Tamşa |
<!-- to sign, include a single line above this comment containing the following text:
| @username | First Last |

19
utils/coreutils_test.go Normal file
View 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")
}
}