1
0
mirror of https://github.com/danog/liquid.git synced 2024-12-02 15:17:47 +01:00
liquid/values/parsedate_test.go

18 lines
370 B
Go
Raw Normal View History

2017-07-28 00:11:37 +02:00
package values
2017-07-09 17:06:15 +02:00
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestConstant(t *testing.T) {
2017-07-10 20:33:29 +02:00
dt, err := ParseDate("now")
2017-07-09 17:06:15 +02:00
require.NoError(t, err)
require.True(t, dt.After(timeMustParse("1970-01-01T00:00:00Z")))
2017-07-10 20:33:29 +02:00
dt, err = ParseDate("2017-07-09 10:40:00 UTC")
2017-07-09 17:06:15 +02:00
require.NoError(t, err)
require.Equal(t, timeMustParse("2017-07-09T10:40:00Z"), dt)
}