@@ -177,6 +177,26 @@ setprecision(Interval, Float64)
177
177
setformat (:full )
178
178
@test string (X) == " IntervalBox(Interval(-Inf, Inf), 2)"
179
179
180
+
181
+ setformat (:standard )
182
+ a = IntervalBox (1 .. 2 , 2 .. 3 )
183
+ @test string (a) == " [1, 2] × [2, 3]"
184
+
185
+ b = IntervalBox (emptyinterval (), 2 )
186
+ @test string (b) == " ∅²"
187
+
188
+ c = IntervalBox (1 .. 2 , 1 )
189
+ @test string (c) == " [1, 2]¹"
190
+
191
+ setformat (:full )
192
+ @test string (a) == " IntervalBox(Interval(1.0, 2.0), Interval(2.0, 3.0))"
193
+ @test string (b) == " IntervalBox(∅, 2)"
194
+ @test string (c) == " IntervalBox(Interval(1.0, 2.0), 1)"
195
+
196
+ setformat (:midpoint )
197
+ @test string (a) == " (1.5 ± 0.5) × (2.5 ± 0.5)"
198
+ @test string (b) == " ∅²"
199
+ @test string (c) == " (1.5 ± 0.5)¹"
180
200
end
181
201
end
182
202
203
223
setformat (decorations= true )
204
224
@test string (x) == " [0, 1]₁₂₈_def"
205
225
226
+ a = IntervalBox (1 .. 2 , 2 .. 3 )
227
+ b = IntervalBox (emptyinterval (), 2 )
228
+ c = IntervalBox (1 .. 2 , 1 )
229
+
230
+ @test sprint (showfull, a) == " IntervalBox(Interval(1.0, 2.0), Interval(2.0, 3.0))"
231
+ @test sprint (showfull, b) == " IntervalBox(∅, 2)"
232
+ @test sprint (showfull, c) == " IntervalBox(Interval(1.0, 2.0), 1)"
233
+
206
234
end
207
235
208
236
@testset " @format tests" begin
0 commit comments