Skip to content

Commit

Permalink
Revise tests to work with printing type aliases
Browse files Browse the repository at this point in the history
Introduced in JuliaLang/julia#36107
  • Loading branch information
omus committed Jul 9, 2020
1 parent 80883af commit e0df780
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ zdt = ZonedDateTime(dt, warsaw)
@test sprint(show, MIME("text/plain"), zdt) == "1942-12-25T01:23:45+01:00"

# Note: Test can be removed once `:compact_el` code is eliminated
@test sprint(show, MIME("text/plain"), [zdt]) == "1-element Array{ZonedDateTime,1}:\n 1942-12-25T01:23:45+01:00"
zdt_vector = [zdt]
@test sprint(show, MIME("text/plain"), zdt_vector) == summary(zdt_vector) * ":\n 1942-12-25T01:23:45+01:00"

prefix = VERSION >= v"1.5.0-DEV.224" ? "" : "ZonedDateTime"
@test sprint(show, [zdt]; context=:compact => true) == "$prefix[ZonedDateTime(1942, 12, 25, 1, 23, 45, tz\"Europe/Warsaw\")]"
@test sprint(show, zdt_vector; context=:compact => true) == "$prefix[ZonedDateTime(1942, 12, 25, 1, 23, 45, tz\"Europe/Warsaw\")]"


# TimeZone parsing
Expand Down

0 comments on commit e0df780

Please sign in to comment.