Skip to content

Commit 0edde83

Browse files
JeffBezansonKristofferC
authored and
KristofferC
committed
fixup to #51743, timetype subtraction
Restores the method whose removal was probably causing problems. (cherry picked from commit f6f1ee9)
1 parent cba88c1 commit 0edde83

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/Dates/test/arithmetic.jl

+5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ using Dates
1111
@test Dates.CompoundPeriod(a - b) == Dates.Hour(12)
1212
end
1313

14+
struct MonthlyDate <: TimeType
15+
instant::Dates.UTInstant{Month}
16+
end
1417
@testset "TimeType arithmetic" begin
1518
@test_throws MethodError DateTime(2023, 5, 2) - Date(2023, 5, 1)
19+
# check that - between two same-type TimeTypes works by default
20+
@test MonthlyDate(Dates.UTInstant(Month(10))) - MonthlyDate(Dates.UTInstant(Month(1))) == Month(9)
1621
end
1722

1823
@testset "Wrapping arithmetic for Months" begin

0 commit comments

Comments
 (0)