@@ -6,65 +6,65 @@ using Test
66
77@testset " StatFiles" begin
88
9- ar = load (" types.dta" ) |> IteratorInterfaceExtensions. getiterator |> collect
9+ ar = load (" types.dta" ) |> IteratorInterfaceExtensions. getiterator |> collect
1010
11- @test length (ar) == 3
12- @test ar[1 ] == (vfloat= DataValue {Float32} (3.14 ), vdouble= DataValue (3.14 ), vlong= DataValue {Int32} (2 ), vint= DataValue {Int16} (2 ), vbyte= DataValue {Int8} (2 ), vstring= DataValue (" 2" ))
13- @test ar[2 ] == (vfloat= DataValue {Float32} (7. ), vdouble= DataValue (7. ), vlong= DataValue {Int32} (7 ), vint= DataValue {Int16} (7 ), vbyte= DataValue {Int8} (7 ), vstring= DataValue (" 7" ))
14- @test ar[3 ] == (vfloat= DataValue {Float32} (), vdouble= DataValue {Float64} (), vlong= DataValue {Int32} (), vint= DataValue {Int16} (), vbyte= DataValue {Int8} (), vstring= DataValue (" " ))
15- @test TableTraits. isiterabletable (load (" types.dta" )) == true
16- @test IteratorInterfaceExtensions. isiterable (load (" types.dta" )) == true
11+ @test length (ar) == 3
12+ @test ar[1 ] == (vfloat = DataValue {Float32} (3.14 ), vdouble = DataValue (3.14 ), vlong = DataValue {Int32} (2 ), vint = DataValue {Int16} (2 ), vbyte = DataValue {Int8} (2 ), vstring = DataValue (" 2" ))
13+ @test ar[2 ] == (vfloat = DataValue {Float32} (7. ), vdouble = DataValue (7. ), vlong = DataValue {Int32} (7 ), vint = DataValue {Int16} (7 ), vbyte = DataValue {Int8} (7 ), vstring = DataValue (" 7" ))
14+ @test ar[3 ] == (vfloat = DataValue {Float32} (), vdouble = DataValue {Float64} (), vlong = DataValue {Int32} (), vint = DataValue {Int16} (), vbyte = DataValue {Int8} (), vstring = DataValue (" " ))
15+ @test TableTraits. isiterabletable (load (" types.dta" )) == true
16+ @test IteratorInterfaceExtensions. isiterable (load (" types.dta" )) == true
1717
18- ar = load (" types.sas7bdat" ) |> IteratorInterfaceExtensions. getiterator |> collect
18+ ar = load (" types.sas7bdat" ) |> IteratorInterfaceExtensions. getiterator |> collect
1919
20- @test length (ar) == 3
21- @test ar[1 ] == (vfloat= DataValue {Float32} (3.14 ), vdouble= DataValue (3.14 ), vlong= DataValue {Int32} (2 ), vint= DataValue {Int16} (2 ), vbyte= DataValue {Int8} (2 ), vstring= DataValue (" 2" ))
22- @test ar[2 ] == (vfloat= DataValue {Float32} (7. ), vdouble= DataValue (7. ), vlong= DataValue {Int32} (7 ), vint= DataValue {Int16} (7 ), vbyte= DataValue {Int8} (7 ), vstring= DataValue (" 7" ))
23- @test ar[3 ] == (vfloat= DataValue {Float32} (), vdouble= DataValue {Float64} (), vlong= DataValue {Int32} (), vint= DataValue {Int16} (), vbyte= DataValue {Int8} (), vstring= DataValue (" " ))
24- @test TableTraits. isiterabletable (load (" types.sas7bdat" )) == true
25- @test IteratorInterfaceExtensions. isiterable (load (" types.sas7bdat" )) == true
20+ @test length (ar) == 3
21+ @test ar[1 ] == (vfloat = DataValue {Float32} (3.14 ), vdouble = DataValue (3.14 ), vlong = DataValue {Int32} (2 ), vint = DataValue {Int16} (2 ), vbyte = DataValue {Int8} (2 ), vstring = DataValue (" 2" ))
22+ @test ar[2 ] == (vfloat = DataValue {Float32} (7. ), vdouble = DataValue (7. ), vlong = DataValue {Int32} (7 ), vint = DataValue {Int16} (7 ), vbyte = DataValue {Int8} (7 ), vstring = DataValue (" 7" ))
23+ @test ar[3 ] == (vfloat = DataValue {Float32} (), vdouble = DataValue {Float64} (), vlong = DataValue {Int32} (), vint = DataValue {Int16} (), vbyte = DataValue {Int8} (), vstring = DataValue (" " ))
24+ @test TableTraits. isiterabletable (load (" types.sas7bdat" )) == true
25+ @test IteratorInterfaceExtensions. isiterable (load (" types.sas7bdat" )) == true
2626
27- ar = load (" types.sav" ) |> IteratorInterfaceExtensions. getiterator |> collect
27+ ar = load (" types.sav" ) |> IteratorInterfaceExtensions. getiterator |> collect
2828
29- @test length (ar) == 3
30- @test ar[1 ] == (vfloat= DataValue {Float32} (3.14 ), vdouble= DataValue (3.14 ), vlong= DataValue {Int32} (2 ), vint= DataValue {Int16} (2 ), vbyte= DataValue {Int8} (2 ), vstring= DataValue (" 2" ))
31- @test ar[2 ] == (vfloat= DataValue {Float32} (7. ), vdouble= DataValue (7. ), vlong= DataValue {Int32} (7 ), vint= DataValue {Int16} (7 ), vbyte= DataValue {Int8} (7 ), vstring= DataValue (" 7" ))
32- @test ar[3 ] == (vfloat= DataValue {Float32} (), vdouble= DataValue {Float64} (), vlong= DataValue {Int32} (), vint= DataValue {Int16} (), vbyte= DataValue {Int8} (), vstring= DataValue (" " ))
33- @test TableTraits. isiterabletable (load (" types.sav" )) == true
34- @test IteratorInterfaceExtensions. isiterable (load (" types.sav" )) == true
29+ @test length (ar) == 3
30+ @test ar[1 ] == (vfloat = DataValue {Float32} (3.14 ), vdouble = DataValue (3.14 ), vlong = DataValue {Int32} (2 ), vint = DataValue {Int16} (2 ), vbyte = DataValue {Int8} (2 ), vstring = DataValue (" 2" ))
31+ @test ar[2 ] == (vfloat = DataValue {Float32} (7. ), vdouble = DataValue (7. ), vlong = DataValue {Int32} (7 ), vint = DataValue {Int16} (7 ), vbyte = DataValue {Int8} (7 ), vstring = DataValue (" 7" ))
32+ @test ar[3 ] == (vfloat = DataValue {Float32} (), vdouble = DataValue {Float64} (), vlong = DataValue {Int32} (), vint = DataValue {Int16} (), vbyte = DataValue {Int8} (), vstring = DataValue (" " ))
33+ @test TableTraits. isiterabletable (load (" types.sav" )) == true
34+ @test IteratorInterfaceExtensions. isiterable (load (" types.sav" )) == true
3535
3636end
3737
3838@testset " Show" begin
3939
40- ar = load (" types.dta" )
40+ ar = load (" types.dta" )
4141
42- @test sprint ((stream,data)-> show (stream, " text/html" , data), ar) == " <table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2</td><td>2</td><td>2</td><td>"2"</td></tr><tr><td>7.0</td><td>7.0</td><td>7</td><td>7</td><td>7</td><td>"7"</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>""</td></tr></tbody></table>"
43- @test sprint ((stream,data)-> show (stream, " application/vnd.dataresource+json" , data), ar) ==
42+ @test sprint ((stream, data)-> show (stream, " text/html" , data), ar) == " <table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2</td><td>2</td><td>2</td><td>"2"</td></tr><tr><td>7.0</td><td>7.0</td><td>7</td><td>7</td><td>7</td><td>"7"</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>""</td></tr></tbody></table>"
43+ @test sprint ((stream, data)-> show (stream, " application/vnd.dataresource+json" , data), ar) ==
4444" {\" schema\" :{\" fields\" :[{\" name\" :\" vfloat\" ,\" type\" :\" number\" },{\" name\" :\" vdouble\" ,\" type\" :\" number\" },{\" name\" :\" vlong\" ,\" type\" :\" integer\" },{\" name\" :\" vint\" ,\" type\" :\" integer\" },{\" name\" :\" vbyte\" ,\" type\" :\" integer\" },{\" name\" :\" vstring\" ,\" type\" :\" string\" }]},\" data\" :[{\" vfloat\" :3.14,\" vdouble\" :3.14,\" vlong\" :2,\" vint\" :2,\" vbyte\" :2,\" vstring\" :\" 2\" },{\" vfloat\" :7.0,\" vdouble\" :7.0,\" vlong\" :7,\" vint\" :7,\" vbyte\" :7,\" vstring\" :\" 7\" },{\" vfloat\" :null,\" vdouble\" :null,\" vlong\" :null,\" vint\" :null,\" vbyte\" :null,\" vstring\" :\"\" }]}"
45- @test sprint (show, ar) == " 3x6 STATA file\n vfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n ───────┼─────────┼───────┼──────┼───────┼────────\n 3.14 │ 3.14 │ 2 │ 2 │ 2 │ \" 2\" \n 7.0 │ 7.0 │ 7 │ 7 │ 7 │ \" 7\" \n #NA │ #NA │ #NA │ #NA │ #NA │ \"\" "
45+ @test sprint (show, ar) == " 3x6 STATA file\n vfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n ───────┼─────────┼───────┼──────┼───────┼────────\n 3.14 │ 3.14 │ 2 │ 2 │ 2 │ \" 2\" \n 7.0 │ 7.0 │ 7 │ 7 │ 7 │ \" 7\" \n #NA │ #NA │ #NA │ #NA │ #NA │ \"\" "
4646
47- @test showable (" text/html" , ar) == true
48- @test showable (" application/vnd.dataresource+json" , ar) == true
47+ @test showable (" text/html" , ar) == true
48+ @test showable (" application/vnd.dataresource+json" , ar) == true
4949
50- ar = load (" types.sas7bdat" )
50+ ar = load (" types.sas7bdat" )
5151
52- @test sprint ((stream,data)-> show (stream, " text/html" , data), ar) == " <table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2.0</td><td>2.0</td><td>2.0</td><td>"2"</td></tr><tr><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>"7"</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>""</td></tr></tbody></table>"
53- @test sprint ((stream,data)-> show (stream, " application/vnd.dataresource+json" , data), ar) ==
52+ @test sprint ((stream, data)-> show (stream, " text/html" , data), ar) == " <table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2.0</td><td>2.0</td><td>2.0</td><td>"2"</td></tr><tr><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>"7"</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>""</td></tr></tbody></table>"
53+ @test sprint ((stream, data)-> show (stream, " application/vnd.dataresource+json" , data), ar) ==
5454" {\" schema\" :{\" fields\" :[{\" name\" :\" vfloat\" ,\" type\" :\" number\" },{\" name\" :\" vdouble\" ,\" type\" :\" number\" },{\" name\" :\" vlong\" ,\" type\" :\" number\" },{\" name\" :\" vint\" ,\" type\" :\" number\" },{\" name\" :\" vbyte\" ,\" type\" :\" number\" },{\" name\" :\" vstring\" ,\" type\" :\" string\" }]},\" data\" :[{\" vfloat\" :3.140000104904175,\" vdouble\" :3.14,\" vlong\" :2.0,\" vint\" :2.0,\" vbyte\" :2.0,\" vstring\" :\" 2\" },{\" vfloat\" :7.0,\" vdouble\" :7.0,\" vlong\" :7.0,\" vint\" :7.0,\" vbyte\" :7.0,\" vstring\" :\" 7\" },{\" vfloat\" :null,\" vdouble\" :null,\" vlong\" :null,\" vint\" :null,\" vbyte\" :null,\" vstring\" :\"\" }]}"
55- @test sprint (show, ar) == " 3x6 SAS file\n vfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n ───────┼─────────┼───────┼──────┼───────┼────────\n 3.14 │ 3.14 │ 2.0 │ 2.0 │ 2.0 │ \" 2\" \n 7.0 │ 7.0 │ 7.0 │ 7.0 │ 7.0 │ \" 7\" \n #NA │ #NA │ #NA │ #NA │ #NA │ \"\" "
55+ @test sprint (show, ar) == " 3x6 SAS file\n vfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n ───────┼─────────┼───────┼──────┼───────┼────────\n 3.14 │ 3.14 │ 2.0 │ 2.0 │ 2.0 │ \" 2\" \n 7.0 │ 7.0 │ 7.0 │ 7.0 │ 7.0 │ \" 7\" \n #NA │ #NA │ #NA │ #NA │ #NA │ \"\" "
5656
57- @test showable (" text/html" , ar) == true
58- @test showable (" application/vnd.dataresource+json" , ar) == true
57+ @test showable (" text/html" , ar) == true
58+ @test showable (" application/vnd.dataresource+json" , ar) == true
5959
60- ar = load (" types.sav" )
60+ ar = load (" types.sav" )
6161
62- @test sprint ((stream,data)-> show (stream, " text/html" , data), ar) == " <table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2.0</td><td>2.0</td><td>2.0</td><td>"2"</td></tr><tr><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>"7"</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>""</td></tr></tbody></table>"
63- @test sprint ((stream,data)-> show (stream, " application/vnd.dataresource+json" , data), ar) ==
62+ @test sprint ((stream, data)-> show (stream, " text/html" , data), ar) == " <table><thead><tr><th>vfloat</th><th>vdouble</th><th>vlong</th><th>vint</th><th>vbyte</th><th>vstring</th></tr></thead><tbody><tr><td>3.14</td><td>3.14</td><td>2.0</td><td>2.0</td><td>2.0</td><td>"2"</td></tr><tr><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>7.0</td><td>"7"</td></tr><tr><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>#NA</td><td>""</td></tr></tbody></table>"
63+ @test sprint ((stream, data)-> show (stream, " application/vnd.dataresource+json" , data), ar) ==
6464" {\" schema\" :{\" fields\" :[{\" name\" :\" vfloat\" ,\" type\" :\" number\" },{\" name\" :\" vdouble\" ,\" type\" :\" number\" },{\" name\" :\" vlong\" ,\" type\" :\" number\" },{\" name\" :\" vint\" ,\" type\" :\" number\" },{\" name\" :\" vbyte\" ,\" type\" :\" number\" },{\" name\" :\" vstring\" ,\" type\" :\" string\" }]},\" data\" :[{\" vfloat\" :3.140000104904175,\" vdouble\" :3.14,\" vlong\" :2.0,\" vint\" :2.0,\" vbyte\" :2.0,\" vstring\" :\" 2\" },{\" vfloat\" :7.0,\" vdouble\" :7.0,\" vlong\" :7.0,\" vint\" :7.0,\" vbyte\" :7.0,\" vstring\" :\" 7\" },{\" vfloat\" :null,\" vdouble\" :null,\" vlong\" :null,\" vint\" :null,\" vbyte\" :null,\" vstring\" :\"\" }]}"
65- @test sprint (show, ar) == " 3x6 SPSS file\n vfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n ───────┼─────────┼───────┼──────┼───────┼────────\n 3.14 │ 3.14 │ 2.0 │ 2.0 │ 2.0 │ \" 2\" \n 7.0 │ 7.0 │ 7.0 │ 7.0 │ 7.0 │ \" 7\" \n #NA │ #NA │ #NA │ #NA │ #NA │ \"\" "
65+ @test sprint (show, ar) == " 3x6 SPSS file\n vfloat │ vdouble │ vlong │ vint │ vbyte │ vstring\n ───────┼─────────┼───────┼──────┼───────┼────────\n 3.14 │ 3.14 │ 2.0 │ 2.0 │ 2.0 │ \" 2\" \n 7.0 │ 7.0 │ 7.0 │ 7.0 │ 7.0 │ \" 7\" \n #NA │ #NA │ #NA │ #NA │ #NA │ \"\" "
6666
67- @test showable (" text/html" , ar) == true
68- @test showable (" application/vnd.dataresource+json" , ar) == true
67+ @test showable (" text/html" , ar) == true
68+ @test showable (" application/vnd.dataresource+json" , ar) == true
6969
7070end
0 commit comments