Skip to content

Commit

Permalink
Test show_term for identity(::Irrational)
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Aug 1, 2022
1 parent 6e60da7 commit 56fd3b9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/code.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,16 @@ test_repr(a, b) = @test repr(Base.remove_linenums!(a)) == repr(Base.remove_linen
@test f(1) == 1
@test f(2) == 2
end

let
io = IOBuffer()
twoπ = Base.Irrational{:twoπ}()
for q Base.Irrational[Base.MathConstants.catalan, Base.MathConstants.γ, π, Base.MathConstants.φ, ℯ, twoπ]
Base.show(io, q)
s1 = String(take!(io))
SymbolicUtils.show_term(io, SymbolicUtils.Term(identity, [q]))
s2 = String(take!(io))
@test s1 == s2
end
end
end

0 comments on commit 56fd3b9

Please sign in to comment.