Skip to content

Commit

Permalink
fixup to #51743, timetype subtraction
Browse files Browse the repository at this point in the history
Restores the method whose removal was probably causing problems.

(cherry picked from commit f6f1ee9)
  • Loading branch information
JeffBezanson authored and KristofferC committed Oct 30, 2023
1 parent cba88c1 commit 0edde83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stdlib/Dates/test/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ using Dates
@test Dates.CompoundPeriod(a - b) == Dates.Hour(12)
end

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

@testset "Wrapping arithmetic for Months" begin
Expand Down

0 comments on commit 0edde83

Please sign in to comment.