(t *testing.T)
| 1414 | } |
| 1415 | |
| 1416 | func TestDurationAdd(t *testing.T) { |
| 1417 | d1 := int64(3600000000000) // 1 hour |
| 1418 | d2 := int64(1800000000000) // 30 minutes |
| 1419 | |
| 1420 | expr := ast.ApplyFn{symbols.DurationAdd, []ast.BaseTerm{ |
| 1421 | ast.Duration(d1), |
| 1422 | ast.Duration(d2), |
| 1423 | }} |
| 1424 | got, err := EvalApplyFn(expr, ast.ConstSubstMap{}) |
| 1425 | if err != nil { |
| 1426 | t.Fatalf("EvalApplyFn(%v) failed with %v", expr, err) |
| 1427 | } |
| 1428 | want := ast.Duration(d1 + d2) |
| 1429 | if !got.Equals(want) { |
| 1430 | t.Errorf("EvalApplyFn(%v) = %v, want %v", expr, got, want) |
| 1431 | } |
| 1432 | } |
| 1433 | |
| 1434 | func TestDurationMult(t *testing.T) { |
| 1435 | d := int64(3600000000000) // 1 hour |
nothing calls this directly
no test coverage detected