Skip to content

Commit

Permalink
1.5.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
lucagrulla committed Aug 1, 2018
1 parent 1837713 commit fb41d43
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func versionCheckOnSigterm(version string, latestVersionChannel chan string) {
}

func main() {
version := "1.5.0"
version := "1.5.1"
kingpin.Version(version).Author("Luca Grulla")
command := kingpin.Parse()

Expand Down
39 changes: 39 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package main

import (
//"fmt"
"github.com/stretchr/testify/assert"
//"reflect"
"testing"
"time"
)

func TestTimestampToUTC(t *testing.T) {
assert := assert.New(t)

a := "2017-03-12"
assert.Equal(timestampToUTC(&a), time.Date(2017, 3, 12, 0, 0, 0, 0, time.UTC),
"wrong parsing for input %s", a)

a = "2017-03-12T18"
assert.Equal(timestampToUTC(&a), time.Date(2017, 3, 12, 18, 0, 0, 0, time.UTC),
"wrong parsing for input %s", a)

a = "2017-03-12T18:22"
assert.Equal(timestampToUTC(&a), time.Date(2017, 3, 12, 18, 22, 0, 0, time.UTC),
"wrong parsing for input %s", a)

a = "2017-03-12T18:22:23"
assert.Equal(timestampToUTC(&a), time.Date(2017, 3, 12, 18, 22, 23, 0, time.UTC),
"wrong parsing for input %s", a)

a = "18"
y, m, d := time.Now().Date()
assert.Equal(timestampToUTC(&a), time.Date(y, m, d, 18, 0, 0, 0, time.UTC),
"wrong parsing for input %s", a)

a = "18:31"
y, m, d = time.Now().Date()
assert.Equal(timestampToUTC(&a), time.Date(y, m, d, 18, 31, 0, 0, time.UTC),
"wrong parsing for input %s", a)
}

0 comments on commit fb41d43

Please sign in to comment.