@@ -45,11 +45,11 @@ let x, b
45
45
@testset " Full" begin
46
46
setformat (:full )
47
47
48
- @test sprint (show, MIME (" text/plain" ), a) == " Interval(1.0, 2.0)"
49
- @test sprint (show, MIME (" text/plain" ), b) == " Interval(-1.1, 1.3)"
50
- @test sprint (show, MIME (" text/plain" ), c) == " Interval(3.141592653589793, 3.1415926535897936)"
48
+ @test sprint (show, MIME (" text/plain" ), a) == " Interval{Float64} (1.0, 2.0)"
49
+ @test sprint (show, MIME (" text/plain" ), b) == " Interval{Float64} (-1.1, 1.3)"
50
+ @test sprint (show, MIME (" text/plain" ), c) == " Interval{Float64} (3.141592653589793, 3.1415926535897936)"
51
51
@test sprint (show, MIME (" text/plain" ), large_expo) ==
52
- " Interval(0.0, 1.000000000000000000000000000000000000000000000000000000000000000000000000000004e+123456789)"
52
+ " Interval{BigFloat} (0.0, 1.000000000000000000000000000000000000000000000000000000000000000000000000000004e+123456789)"
53
53
end
54
54
55
55
@testset " Midpoint" begin
@@ -73,7 +73,7 @@ let x, b
73
73
@test_broken sprint (show, MIME (" text/plain" ), a) == " [1//3, 5//4]"
74
74
75
75
setformat (:full )
76
- @test_broken sprint (show, MIME (" text/plain" ), a) == " Interval(1//3, 5//4)"
76
+ @test_broken sprint (show, MIME (" text/plain" ), a) == " Interval{Rational{Int}} (1//3, 5//4)"
77
77
78
78
setformat (:midpoint )
79
79
@test_broken sprint (show, MIME (" text/plain" ), a) == " 19//24 ± 11//24"
@@ -88,8 +88,8 @@ let x, b
88
88
@test sprint (show, MIME (" text/plain" ), b) == " [-1.0f0, ∞]"
89
89
90
90
setformat (:full )
91
- @test sprint (show, MIME (" text/plain" ), a) == " Interval(1.0f0, 2.0f0)"
92
- @test sprint (show, MIME (" text/plain" ), b) == " Interval(-1.0f0, ∞ )"
91
+ @test sprint (show, MIME (" text/plain" ), a) == " Interval{Float32} (1.0f0, 2.0f0)"
92
+ @test sprint (show, MIME (" text/plain" ), b) == " Interval{Float32} (-1.0f0, Inf32 )"
93
93
94
94
setformat (:midpoint )
95
95
@test sprint (show, MIME (" text/plain" ), a) == " 1.5f0 ± 0.5f0"
@@ -131,7 +131,7 @@ let x, b
131
131
@test sprint (show, MIME (" text/plain" ), a) == " [2.0, 3.0]₂₅₆_com"
132
132
133
133
setformat (:full )
134
- @test sprint (show, MIME (" text/plain" ), a) == " DecoratedInterval(Interval(2.0, 3.0), com)"
134
+ @test sprint (show, MIME (" text/plain" ), a) == " DecoratedInterval(Interval{BigFloat} (2.0, 3.0), com)"
135
135
136
136
setformat (:midpoint )
137
137
@test sprint (show, MIME (" text/plain" ), a) == " (2.5 ± 0.5)₂₅₆_com"
@@ -150,7 +150,7 @@ let x, b
150
150
@test sprint (show, MIME (" text/plain" ), a) == " [1.0, 1.0]₁₂₈"
151
151
152
152
setformat (:full )
153
- @test sprint (show, MIME (" text/plain" ), a) == " Interval(1.0, 1.0)"
153
+ @test sprint (show, MIME (" text/plain" ), a) == " Interval{BigFloat} (1.0, 1.0)"
154
154
155
155
a = DecoratedInterval (big (2 ), big (3 ), com)
156
156
@test typeof (a) == DecoratedInterval{BigFloat}
@@ -162,7 +162,7 @@ let x, b
162
162
@test sprint (show, MIME (" text/plain" ), a) == " [2.0, 3.0]₁₂₈_com"
163
163
164
164
setformat (:full )
165
- @test sprint (show, MIME (" text/plain" ), a) == " DecoratedInterval(Interval(2.0, 3.0), com)"
165
+ @test sprint (show, MIME (" text/plain" ), a) == " DecoratedInterval(Interval{BigFloat} (2.0, 3.0), com)"
166
166
end
167
167
168
168
@testset " IntervalBox" begin
@@ -177,7 +177,7 @@ let x, b
177
177
@test sprint (show, MIME (" text/plain" ), X) == " [-∞, ∞]²"
178
178
179
179
setformat (:full )
180
- @test sprint (show, MIME (" text/plain" ), X) == " IntervalBox(Interval(-Inf, Inf), 2)"
180
+ @test sprint (show, MIME (" text/plain" ), X) == " IntervalBox(Interval{Float64} (-Inf, Inf), 2)"
181
181
182
182
setformat (:standard )
183
183
a = IntervalBox (1 .. 2 , 2 .. 3 )
@@ -188,9 +188,9 @@ let x, b
188
188
@test sprint (show, MIME (" text/plain" ), c) == " [1.0, 2.0]¹"
189
189
190
190
setformat (:full )
191
- @test sprint (show, MIME (" text/plain" ), a) == " IntervalBox(Interval(1.0, 2.0), Interval(2.0, 3.0))"
191
+ @test sprint (show, MIME (" text/plain" ), a) == " IntervalBox(Interval{Float64} (1.0, 2.0), Interval{Float64} (2.0, 3.0))"
192
192
@test sprint (show, MIME (" text/plain" ), b) == " IntervalBox(∅, 2)"
193
- @test sprint (show, MIME (" text/plain" ), c) == " IntervalBox(Interval(1.0, 2.0), 1)"
193
+ @test sprint (show, MIME (" text/plain" ), c) == " IntervalBox(Interval{Float64} (1.0, 2.0), 1)"
194
194
195
195
setformat (:midpoint )
196
196
@test sprint (show, MIME (" text/plain" ), a) == " (1.5 ± 0.5) × (2.5 ± 0.5)"
@@ -205,19 +205,19 @@ end
205
205
206
206
x = 0 .. 1
207
207
@test sprint (show, MIME (" text/plain" ), x) == " [0.0, 1.0]"
208
- @test sprint (show, x) == " Interval(0.0, 1.0)"
208
+ @test sprint (show, x) == " Interval{Float64} (0.0, 1.0)"
209
209
210
210
x = @biginterval (0 , 1 )
211
211
@test sprint (show, MIME (" text/plain" ), x) == " [0.0, 1.0]₁₂₈"
212
- @test sprint (show, x) == " Interval(0.0, 1.0)"
212
+ @test sprint (show, x) == " Interval{BigFloat} (0.0, 1.0)"
213
213
214
214
x = DecoratedInterval (0 , 1 , dac)
215
215
@test sprint (show, MIME (" text/plain" ), x) == " [0.0, 1.0]"
216
- @test sprint (show, x) == " DecoratedInterval(Interval(0.0, 1.0), dac)"
216
+ @test sprint (show, x) == " DecoratedInterval(Interval{Float64} (0.0, 1.0), dac)"
217
217
218
218
x = DecoratedInterval (big (0 ), big (1 ), def)
219
219
@test sprint (show, MIME (" text/plain" ), x) == " [0.0, 1.0]₁₂₈"
220
- @test sprint (show, x) == " DecoratedInterval(Interval(0.0, 1.0), def)"
220
+ @test sprint (show, x) == " DecoratedInterval(Interval{BigFloat} (0.0, 1.0), def)"
221
221
222
222
setformat (; decorations = true )
223
223
@test sprint (show, MIME (" text/plain" ), x) == " [0.0, 1.0]₁₂₈_def"
@@ -226,17 +226,17 @@ end
226
226
b = IntervalBox (emptyinterval (), 2 )
227
227
c = IntervalBox (1 .. 2 , 1 )
228
228
229
- @test sprint (show, a) == " IntervalBox(Interval(1.0, 2.0), Interval(2.0, 3.0))"
229
+ @test sprint (show, a) == " IntervalBox(Interval{Float64} (1.0, 2.0), Interval{Float64} (2.0, 3.0))"
230
230
@test sprint (show, b) == " IntervalBox(∅, 2)"
231
- @test sprint (show, c) == " IntervalBox(Interval(1.0, 2.0), 1)"
231
+ @test sprint (show, c) == " IntervalBox(Interval{Float64} (1.0, 2.0), 1)"
232
232
233
233
end
234
234
235
235
@testset " @format tests" begin
236
236
x = prevfloat (0.1 ).. nextfloat (0.3 )
237
237
238
238
@format full
239
- @test sprint (show, MIME (" text/plain" ), x) == " Interval(0.09999999999999999, 0.30000000000000004)"
239
+ @test sprint (show, MIME (" text/plain" ), x) == " Interval{Float64} (0.09999999999999999, 0.30000000000000004)"
240
240
241
241
@format standard 3
242
242
@test sprint (show, MIME (" text/plain" ), x) == " [0.0999, 0.301]"
0 commit comments