MCPcopy Index your code
hub / github.com/google/mangle / TestIntegration_IntervalFunctions

Function TestIntegration_IntervalFunctions

engine/temporal_integration_test.go:466–490  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

464}
465
466func TestIntegration_IntervalFunctions(t *testing.T) {
467 // Test the interval extraction functions
468 program := `
469 # Extract interval components
470 Decl status(X) temporal.
471 `
472
473 _, err := parse.Unit(strings.NewReader(program))
474 if err != nil {
475 t.Fatalf("Failed to parse program: %v", err)
476 }
477
478 // Test interval to constant conversion
479 interval := ast.TimeInterval(
480 ast.Date(2024, 1, 1),
481 ast.Date(2024, 12, 31),
482 )
483
484 intervalConst := intervalToConstant(interval)
485
486 // Verify it's a pair
487 if intervalConst.Type != ast.PairShape {
488 t.Errorf("intervalToConstant returned type %v, want PairShape", intervalConst.Type)
489 }
490}
491
492func TestIntegration_BackwardCompatibility(t *testing.T) {
493 // These programs should parse and run correctly without temporal features

Callers

nothing calls this directly

Calls 4

UnitFunction · 0.92
TimeIntervalFunction · 0.92
DateFunction · 0.92
intervalToConstantFunction · 0.85

Tested by

no test coverage detected