MCPcopy
hub / github.com/google/mangle / TestTimeTruncInvalid

Function TestTimeTruncInvalid

functional/functional_test.go:1404–1414  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1402}
1403
1404func TestTimeTruncInvalid(t *testing.T) {
1405 nanos := int64(1705314600000000000)
1406 expr := ast.ApplyFn{symbols.TimeTrunc, []ast.BaseTerm{
1407 ast.Time(nanos),
1408 name("/year"), // year not supported by Truncate in this way
1409 }}
1410 _, err := EvalApplyFn(expr, ast.ConstSubstMap{})
1411 if err == nil {
1412 t.Fatalf("EvalApplyFn(%v) expected error, got nil", expr)
1413 }
1414}
1415
1416func TestDurationAdd(t *testing.T) {
1417 d1 := int64(3600000000000) // 1 hour

Callers

nothing calls this directly

Calls 3

TimeFunction · 0.92
EvalApplyFnFunction · 0.85
nameFunction · 0.70

Tested by

no test coverage detected