Skip to content

Commit

Permalink
Revert spacing in Base.show (#148)
Browse files Browse the repository at this point in the history
* revert spacings in Base.show

* bump version to v0.7.6
  • Loading branch information
hyrodium authored Jul 29, 2023
1 parent 5f3bf67 commit c318936
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "IntervalSets"
uuid = "8197267c-284f-5f27-9208-e0e47529a953"
version = "0.7.5"
version = "0.7.6"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
8 changes: 4 additions & 4 deletions src/interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ Construct a ClosedInterval `iv` spanning the region from
±(x, y) = ClosedInterval(x - y, x + y)
±(x::CartesianIndex, y::CartesianIndex) = ClosedInterval(x-y, x+y)

show(io::IO, I::ClosedInterval) = print(io, leftendpoint(I), " .. ", rightendpoint(I))
show(io::IO, I::OpenInterval) = print(io, leftendpoint(I), " .. ", rightendpoint(I), " (open)")
show(io::IO, I::Interval{:open,:closed}) = print(io, leftendpoint(I), " .. ", rightendpoint(I), " (open-closed)")
show(io::IO, I::Interval{:closed,:open}) = print(io, leftendpoint(I), " .. ", rightendpoint(I), " (closed-open)")
show(io::IO, I::ClosedInterval) = print(io, leftendpoint(I), "..", rightendpoint(I))
show(io::IO, I::OpenInterval) = print(io, leftendpoint(I), "..", rightendpoint(I), " (open)")
show(io::IO, I::Interval{:open,:closed}) = print(io, leftendpoint(I), "..", rightendpoint(I), " (open-closed)")
show(io::IO, I::Interval{:closed,:open}) = print(io, leftendpoint(I), "..", rightendpoint(I), " (closed-open)")

# The following are not typestable for mixed endpoint types
_left_intersect_type(::Type{Val{:open}}, ::Type{Val{L2}}, a1, a2) where L2 = a1 < a2 ? (a2,L2) : (a1,:open)
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct IncompleteInterval <: AbstractInterval{Int} end
I = 0..3
@test I === ClosedInterval(0,3) === ClosedInterval{Int}(0,3) ===
Interval(0,3)
@test string(I) == "0 .. 3"
@test string(I) == "0..3"
@test @inferred(UnitRange(I)) === 0:3
@test @inferred(range(I)) === 0:3
@test @inferred(UnitRange{Int16}(I)) === Int16(0):Int16(3)
Expand All @@ -47,7 +47,7 @@ struct IncompleteInterval <: AbstractInterval{Int} end
K = 5..4
L = 3 ± 2
M = @inferred(ClosedInterval(2, 5.0))
@test string(M) == "2.0 .. 5.0"
@test string(M) == "2.0..5.0"
N = @inferred(ClosedInterval(UInt8(255), 300))

x, y = CartesianIndex(1, 2, 3, 4), CartesianIndex(1, 2, 3, 4)
Expand Down

2 comments on commit c318936

@hyrodium
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/88600

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.6 -m "<description of version>" c31893674f1217d1919ae3440de18987a9557f2d
git push origin v0.7.6

Please sign in to comment.