File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
- @testset " string" begin
1
+ function test_string_and_show (x, s)
2
+ b = IOBuffer
3
+ show (b, x)
4
+ @test String (take! (b)) == string (x) == s
5
+ end
2
6
3
- @test string (Double64 (pi )) == " 3.14159265358979323846264338327950588"
7
+ @testset " string" begin
8
+ test_string_and_show (Double64 (pi ), " 3.14159265358979323846264338327950588" )
4
9
5
- @test string (Double64 (2.3045377697175683e-24 , - 1.5436846311151439e-40 )) == " 2.30453776971756809999999999999975586e-24"
10
+ x = Double64 (2.3045377697175683e-24 , - 1.5436846311151439e-40 )
11
+ test_string_and_show (x, " 2.30453776971756809999999999999975586e-24" )
6
12
7
- @test string (ComplexDF64 (1.0 ,1.0 )) == " 1.0 + 1.0im"
13
+ test_string_and_show (ComplexDF64 (1.0 ,1.0 ), " 1.0 + 1.0im" )
14
+
15
+ x = Complex {Double64} (pi )+ Double64 (pi )* im
16
+ test_string_and_show (x, " 3.14159265358979323846264338327950588 + 3.14159265358979323846264338327950588im" )
8
17
9
18
@test stringtyped (Double64 (pi )) == " Double64(3.141592653589793, 1.2246467991473532e-16)"
10
19
You can’t perform that action at this time.
0 commit comments