From 56fd3b9735f729fae3e1fc9dad7a13dc886c720f Mon Sep 17 00:00:00 2001 From: "user.email" Date: Mon, 1 Aug 2022 14:10:43 -0400 Subject: [PATCH] Test show_term for identity(::Irrational) --- test/code.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/code.jl b/test/code.jl index 31290e67e..5a10ca0c2 100644 --- a/test/code.jl +++ b/test/code.jl @@ -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