@@ -20,24 +20,9 @@ i = 1234567
20
20
@test fmt (i) == " 1234567"
21
21
@test fmt (i,:commas ) == " 1,234,567"
22
22
23
- # All Number types are now handled, default is right aligned string
23
+ # These are not handled
24
24
# @test_throws ErrorException fmt_default(Real)
25
25
# @test_throws ErrorException fmt_default(Complex)
26
- fmt_default (Real) == fmt_default (Number) == FormatSpec (' s' , align = ' >' )
27
-
28
- @test fmt (2 - 3im , 10 ) == " 2 - 3im"
29
- @test fmt (pi - 3im , 15 , 2 ) == " 3.14 - 3.00im"
30
-
31
- @test fmt (3 // 4 , 10 ) == " 3//4"
32
- @test fmt (1 // 2 + 6 // 2 * im, 15 ) == " 1//2 + 3//1*im"
33
-
34
- fmt_default! (Rational, ' f' , prec = 2 )
35
- fmt_default! (Format. ComplexRational, ' f' , prec = 2 )
36
-
37
- @test fmt (3 // 4 , 10 , 2 ) == " 0.75"
38
- @test fmt (3 // 4 , 10 , 1 ) == " 0.8"
39
- @test fmt (1 // 2 + 6 // 2 * im, 23 ) == " 0.500000 + 3.000000im"
40
- @test fmt (1 // 2 + 6 // 2 * im, 15 , 2 ) == " 0.50 + 3.00im"
41
26
42
27
fmt_default! (Int, :commas , width = 12 )
43
28
@test fmt (i) == " 1,234,567"
@@ -63,3 +48,19 @@ v = pi
63
48
64
49
v = MathConstants. eulergamma
65
50
@test fmt (v, 10 , 2 ) == " γ"
51
+
52
+ fmt_default (Real) == fmt_default (Number) == FormatSpec (' s' , align = ' >' )
53
+
54
+ @test fmt (2 - 3im , 10 ) == " 2 - 3im"
55
+ @test fmt (pi - 3im , 15 , 2 ) == " 3.14 - 3.00im"
56
+
57
+ @test fmt (3 // 4 , 10 ) == " 3//4"
58
+ @test fmt (1 // 2 + 6 // 2 * im, 15 ) == " 1//2 + 3//1*im"
59
+
60
+ fmt_default! (Rational, ' f' , prec = 2 )
61
+ fmt_default! (Format. ComplexRational, ' f' , prec = 2 )
62
+
63
+ @test fmt (3 // 4 , 10 , 2 ) == " 0.75"
64
+ @test fmt (3 // 4 , 10 , 1 ) == " 0.8"
65
+ @test fmt (1 // 2 + 6 // 2 * im, 23 ) == " 0.500000 + 3.000000im"
66
+ @test fmt (1 // 2 + 6 // 2 * im, 15 , 2 ) == " 0.50 + 3.00im"
0 commit comments