Skip to content

Commit

Permalink
add test to check we error when no prefix is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Ianlmgoddard committed Apr 21, 2021
1 parent 0e4fbaa commit abdb3f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/anchoredinterval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,13 @@ using Intervals: Bounded, Ending, Beginning, canonicalize, isunbounded
"AnchoredInterval{25,Char,Closed,Open}('a')"
end
@test sprint(show, interval) == shown

# Error if no prefix defined for the given period type
interval = AnchoredInterval{Microsecond(-1)}(Date(dt))
@test_throws ErrorException sprint(print, interval)

interval = AnchoredInterval{Nanosecond(-1)}(Date(dt))
@test_throws ErrorException sprint(print, interval)
end

@testset "equality" begin
Expand Down

0 comments on commit abdb3f8

Please sign in to comment.