1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-16 11:37:36 +02:00
ferret/pkg/stdlib/datetime/now_test.go

28 lines
476 B
Go
Raw Normal View History

2018-10-30 21:59:18 +02:00
package datetime_test
import (
"testing"
"github.com/MontFerret/ferret/pkg/stdlib/datetime"
2018-11-01 01:26:36 +02:00
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/MontFerret/ferret/pkg/runtime/values"
2018-10-30 21:59:18 +02:00
)
func TestNow(t *testing.T) {
tcs := []*testCase{
&testCase{
Name: "When too many arguments",
Expected: values.None,
Args: []core.Value{
values.NewCurrentDateTime(),
},
ShouldErr: true,
},
}
for _, tc := range tcs {
2018-11-01 01:26:36 +02:00
tc.Do(t, datetime.Now)
2018-10-30 21:59:18 +02:00
}
}