-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ulrich Lissé
committed
Apr 5, 2019
1 parent
f0a96d0
commit 1c1931e
Showing
7 changed files
with
33 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package date | ||
package datetime | ||
|
||
import "time" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package date | ||
package datetime | ||
|
||
import ( | ||
"math" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
package date_test | ||
package datetime_test | ||
|
||
import ( | ||
"github.com/leanovate/mite-go/date" | ||
"github.com/leanovate/mite-go/datetime" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func Test_ParseMinutes(t *testing.T) { | ||
expected := date.NewMinutes(23) | ||
actual, err := date.ParseMinutes("23m") | ||
expected := datetime.NewMinutes(23) | ||
actual, err := datetime.ParseMinutes("23m") | ||
|
||
assert.Nil(t, err) | ||
assert.Equal(t, expected, actual) | ||
|
||
actual, err = date.ParseMinutes("23m11s") | ||
actual, err = datetime.ParseMinutes("23m11s") | ||
|
||
assert.Nil(t, err) | ||
assert.Equal(t, expected, actual) | ||
|
||
_, err = date.ParseMinutes("1970-01-01") | ||
_, err = datetime.ParseMinutes("1970-01-01") | ||
assert.NotNil(t, err) | ||
} | ||
|
||
func TestMinutes_Value(t *testing.T) { | ||
expected := 23 | ||
actual := date.NewMinutes(23).Value() | ||
actual := datetime.NewMinutes(23).Value() | ||
|
||
assert.Equal(t, expected, actual) | ||
} | ||
|
||
func TestMinutes_String(t *testing.T) { | ||
expected := "23m0s" | ||
actual := date.NewMinutes(23).String() | ||
actual := datetime.NewMinutes(23).String() | ||
|
||
assert.Equal(t, expected, actual) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters