Skip to content

Commit

Permalink
add test: show matrix of Union{Int, Rational{Int}}
Browse files Browse the repository at this point in the history
  • Loading branch information
kalmarek committed Mar 5, 2023
1 parent 6264b0b commit 9a075c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/rational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ end
@test sprint(show, rational2) == "-1//2"
@test sprint(show, -2//2) == "-1//1"
@test sprint(show, [-2//2,]) == "Rational{Int64}[-1]"
@test sprint(show, MIME"text/plain"(), Union{Int, Rational{Int}}[7 3//6; 6//3 2]) ==
"2×2 Matrix{Union{Rational{Int64}, Int64}}:\n 7 1//2\n 2 2"
let
io1 = IOBuffer()
write(io1, rational1)
Expand Down

0 comments on commit 9a075c6

Please sign in to comment.