Skip to content

Commit

Permalink
Merge pull request #320 from JuliaLang/ksh/union
Browse files Browse the repository at this point in the history
Some more tests for union! and isjoinable
  • Loading branch information
kshyatt authored and KristofferC committed Jun 12, 2018
1 parent 83ce7ba commit 529761a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions stdlib/Pkg/test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@ temp_pkg_dir() do project_path
Pkg.up(; level = UpgradeLevel(:minor))
@test Pkg.installed()[TEST_PKG.name].minor != 3
Pkg.rm(TEST_PKG.name)

@test sprint(print, VersionRange("0-0.3.2")) == "0.0.0-0.3.2"
# test missing paths on union! and isjoinable
# there's no == for VersionBound or VersionRange
unified_vr = union!([VersionRange("1.5-2.8"), VersionRange("2.5-3")])[1]
@test unified_vr.lower.t == (UInt32(1), UInt32(5), UInt32(0))
@test unified_vr.upper.t == (UInt32(3), UInt32(0), UInt32(0))
unified_vr = union!([VersionRange("2.5-3"), VersionRange("1.5-2.8")])[1]
@test unified_vr.lower.t == (UInt32(1), UInt32(5), UInt32(0))
@test unified_vr.upper.t == (UInt32(3), UInt32(0), UInt32(0))
unified_vr = union!([VersionRange("1.5-2.2"), VersionRange("2.5-3")])[1]
@test unified_vr.lower.t == (UInt32(1), UInt32(5), UInt32(0))
@test unified_vr.upper.t == (UInt32(2), UInt32(2), UInt32(0))
unified_vr = union!([VersionRange("1.5-2.2"), VersionRange("2.5-3")])[2]
@test unified_vr.lower.t == (UInt32(2), UInt32(5), UInt32(0))
@test unified_vr.upper.t == (UInt32(3), UInt32(0), UInt32(0))
unified_vb = Types.VersionBound(union!([v"1.5", v"1.6"])[1])
@test unified_vb.t == (UInt32(1), UInt32(5), UInt32(0))
unified_vb = Types.VersionBound(union!([v"1.5", v"1.6"])[2])
@test unified_vb.t == (UInt32(1), UInt32(6), UInt32(0))
unified_vb = Types.VersionBound(union!([v"1.5", v"1.5"])[1])
@test unified_vb.t == (UInt32(1), UInt32(5), UInt32(0))
end

@testset "testing" begin
Expand Down

0 comments on commit 529761a

Please sign in to comment.