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

Function TestTimeValueError

ast/ast_test.go:753–766  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

751}
752
753func TestTimeValueError(t *testing.T) {
754 // TimeValue should fail on non-time constants
755 n := Number(42)
756 _, err := n.TimeValue()
757 if err == nil {
758 t.Error("TimeValue() on Number should return error")
759 }
760
761 s := String("2024-01-15T10:30:00Z")
762 _, err = s.TimeValue()
763 if err == nil {
764 t.Error("TimeValue() on String should return error")
765 }
766}
767
768func TestDurationConstant(t *testing.T) {
769 // Zero duration

Callers

nothing calls this directly

Calls 4

NumberFunction · 0.85
StringFunction · 0.85
TimeValueMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected