diff --git a/test/TM1.jl b/test/TM1.jl index 12465b00..900cf81e 100644 --- a/test/TM1.jl +++ b/test/TM1.jl @@ -435,11 +435,19 @@ end @testset "Display" begin tm = TaylorModel1(2, x1, ii1) use_show_default(true) - @test string(exp(tm)) == "TaylorModel1{Interval{Float64},Float64}" * - "(Taylor1{Interval{Float64}}(Interval{Float64}" * - "[Interval(2.718281828459045, 2.7182818284590455), Interval(2.718281828459045, 2.7182818284590455), " * - "Interval(1.3591409142295225, 1.3591409142295228)], 2), Interval(-0.05020487208677604, 0.06448109909211741), " * - "Interval(1.0, 1.0), Interval(0.5, 1.5))" + if VERSION < v"1.6" + @test string(exp(tm)) == "TaylorModel1{Interval{Float64},Float64}" * + "(Taylor1{Interval{Float64}}(Interval{Float64}" * + "[Interval(2.718281828459045, 2.7182818284590455), Interval(2.718281828459045, 2.7182818284590455), " * + "Interval(1.3591409142295225, 1.3591409142295228)], 2), Interval(-0.05020487208677604, 0.06448109909211741), " * + "Interval(1.0, 1.0), Interval(0.5, 1.5))" + else + @test string(exp(tm)) == "TaylorModel1{Interval{Float64}, Float64}" * + "(Taylor1{Interval{Float64}}(Interval{Float64}" * + "[Interval(2.718281828459045, 2.7182818284590455), Interval(2.718281828459045, 2.7182818284590455), " * + "Interval(1.3591409142295225, 1.3591409142295228)], 2), Interval(-0.05020487208677604, 0.06448109909211741), " * + "Interval(1.0, 1.0), Interval(0.5, 1.5))" + end use_show_default(false) @test string(tm^3) == " Interval(1.0, 1.0) + Interval(3.0, 3.0) t + " * "Interval(3.0, 3.0) t² + Interval(-0.125, 0.125)" @@ -447,7 +455,7 @@ end "Interval(2.718281828459045, 2.7182818284590455) t + " * "Interval(1.3591409142295225, 1.3591409142295228) t² + " * "Interval(-0.05020487208677604, 0.06448109909211741)" - end +end @testset "Tests for bounders" begin @testset "Tests for linear dominated bounder" begin @@ -863,11 +871,19 @@ end @testset "Display" begin tm = RTaylorModel1(3, x1, ii1) use_show_default(true) - @test string(exp(tm)) == "RTaylorModel1{Interval{Float64},Float64}" * - "(Taylor1{Interval{Float64}}(Interval{Float64}" * - "[Interval(2.718281828459045, 2.7182818284590455), Interval(2.718281828459045, 2.7182818284590455), " * - "Interval(1.3591409142295225, 1.3591409142295228), Interval(0.45304697140984085, 0.45304697140984096)], 3), " * - "Interval(0.10281598943126369, 0.1256036426541982), Interval(1.0, 1.0), Interval(0.5, 1.5))" + if VERSION < v"1.6" + @test string(exp(tm)) == "RTaylorModel1{Interval{Float64},Float64}" * + "(Taylor1{Interval{Float64}}(Interval{Float64}" * + "[Interval(2.718281828459045, 2.7182818284590455), Interval(2.718281828459045, 2.7182818284590455), " * + "Interval(1.3591409142295225, 1.3591409142295228), Interval(0.45304697140984085, 0.45304697140984096)], 3), " * + "Interval(0.10281598943126369, 0.1256036426541982), Interval(1.0, 1.0), Interval(0.5, 1.5))" + else + @test string(exp(tm)) == "RTaylorModel1{Interval{Float64}, Float64}" * + "(Taylor1{Interval{Float64}}(Interval{Float64}" * + "[Interval(2.718281828459045, 2.7182818284590455), Interval(2.718281828459045, 2.7182818284590455), " * + "Interval(1.3591409142295225, 1.3591409142295228), Interval(0.45304697140984085, 0.45304697140984096)], 3), " * + "Interval(0.10281598943126369, 0.1256036426541982), Interval(1.0, 1.0), Interval(0.5, 1.5))" + end use_show_default(false) @test string(tm^3) == " Interval(1.0, 1.0) + Interval(3.0, 3.0) t + " * "Interval(3.0, 3.0) t² + Interval(1.0, 1.0) t³ + Interval(0.0, 0.0) t⁴" diff --git a/test/TMN.jl b/test/TMN.jl index 7bb77e68..36ac9f13 100644 --- a/test/TMN.jl +++ b/test/TMN.jl @@ -355,17 +355,31 @@ set_variables(Interval{Float64}, [:x, :y], order=_order_max) xm = TaylorModelN(1, _order, b1, ib1) ym = TaylorModelN(2, _order, b1, ib1) use_show_default(true) - @test string(xm+ym) == "TaylorModelN{2,Interval{Float64},Float64}" * - "(TaylorN{Interval{Float64}}" * - "(HomogeneousPolynomial{Interval{Float64}}" * - "[HomogeneousPolynomial{Interval{Float64}}" * - "(Interval{Float64}[Interval(1.0, 1.0)], 0), " * - "HomogeneousPolynomial{Interval{Float64}}" * - "(Interval{Float64}[Interval(1.0, 1.0), Interval(1.0, 1.0)], 1), " * - "HomogeneousPolynomial{Interval{Float64}}" * - "(Interval{Float64}[Interval(0.0, 0.0), Interval(0.0, 0.0), " * - "Interval(0.0, 0.0)], 2)], 2), Interval(0.0, 0.0), IntervalBox(Interval(0.0, 0.0), " * - "Interval(1.0, 1.0)), IntervalBox(Interval(-0.5, 0.5), Interval(0.5, 1.5)))" + if VERSION < v"1.6" + @test string(xm+ym) == "TaylorModelN{2,Interval{Float64},Float64}" * + "(TaylorN{Interval{Float64}}" * + "(HomogeneousPolynomial{Interval{Float64}}" * + "[HomogeneousPolynomial{Interval{Float64}}" * + "(Interval{Float64}[Interval(1.0, 1.0)], 0), " * + "HomogeneousPolynomial{Interval{Float64}}" * + "(Interval{Float64}[Interval(1.0, 1.0), Interval(1.0, 1.0)], 1), " * + "HomogeneousPolynomial{Interval{Float64}}" * + "(Interval{Float64}[Interval(0.0, 0.0), Interval(0.0, 0.0), " * + "Interval(0.0, 0.0)], 2)], 2), Interval(0.0, 0.0), IntervalBox(Interval(0.0, 0.0), " * + "Interval(1.0, 1.0)), IntervalBox(Interval(-0.5, 0.5), Interval(0.5, 1.5)))" + else + @test string(xm+ym) == "TaylorModelN{2, Interval{Float64}, Float64}" * + "(TaylorN{Interval{Float64}}" * + "(HomogeneousPolynomial{Interval{Float64}}" * + "[HomogeneousPolynomial{Interval{Float64}}" * + "(Interval{Float64}[Interval(1.0, 1.0)], 0), " * + "HomogeneousPolynomial{Interval{Float64}}" * + "(Interval{Float64}[Interval(1.0, 1.0), Interval(1.0, 1.0)], 1), " * + "HomogeneousPolynomial{Interval{Float64}}" * + "(Interval{Float64}[Interval(0.0, 0.0), Interval(0.0, 0.0), " * + "Interval(0.0, 0.0)], 2)], 2), Interval(0.0, 0.0), IntervalBox(Interval(0.0, 0.0), " * + "Interval(1.0, 1.0)), IntervalBox(Interval(-0.5, 0.5), Interval(0.5, 1.5)))" + end use_show_default(false) @test string((xm+ym)^2) == " Interval(1.0, 1.0) + Interval(2.0, 2.0) x + " * "Interval(2.0, 2.0) y + Interval(1.0, 1.0) x² + Interval(2.0, 2.0) x y + " *