Fixed DSL test

This commit is contained in:
Ice3man543 2021-11-05 17:04:42 +05:30
parent 0a09b9e451
commit 1c360e0344

View File

@ -21,7 +21,7 @@ func TestDSLURLEncodeDecode(t *testing.T) {
} }
func TestDSLTimeComparison(t *testing.T) { func TestDSLTimeComparison(t *testing.T) {
compiled, err := govaluate.NewEvaluableExpressionWithFunctions("time_now() > not_after", HelperFunctions()) compiled, err := govaluate.NewEvaluableExpressionWithFunctions("unixtime() > not_after", HelperFunctions())
require.Nil(t, err, "could not compare time") require.Nil(t, err, "could not compare time")
result, err := compiled.Evaluate(map[string]interface{}{"not_after": float64(time.Now().Unix() - 1000)}) result, err := compiled.Evaluate(map[string]interface{}{"not_after": float64(time.Now().Unix() - 1000)})