(t *testing.T)
| 751 | } |
| 752 | |
| 753 | func 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 | |
| 768 | func TestDurationConstant(t *testing.T) { |
| 769 | // Zero duration |