Skip to content

Commit

Permalink
Add tests for previous issue #64
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Sep 21, 2017
1 parent 0d6b383 commit 4ca1926
Show file tree
Hide file tree
Showing 2 changed files with 188 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/source.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,8 @@ df = CSV.read(joinpath(dir, "transposed_noheader.csv"); transpose=true, header=0

df = CSV.read(joinpath(dir, "transposed_noheader.csv"); transpose=true, header=["c1", "c2", "c3"])
@test size(df) == (2, 3)
@test Data.header(Data.schema(df)) == ["c1", "c2", "c3"]
@test Data.header(Data.schema(df)) == ["c1", "c2", "c3"]

# #64
df = CSV.read(joinpath(dir, "attenu.csv"), null="NA", types=Dict(3=>Union{Null, String}))
@test size(df) = (182, 5)
183 changes: 183 additions & 0 deletions test/test_files/attenu.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
"Event","Mag","Station","Dist","Accel"
1,7.0,"117",12.0,0.359
2,7.4,"1083",148.0,0.014
2,7.4,"1095",42.0,0.196
2,7.4,"283",85.0,0.135
2,7.4,"135",107.0,0.062
2,7.4,"475",109.0,0.054
2,7.4,"113",156.0,0.014
2,7.4,"1008",224.0,0.018
2,7.4,"1028",293.0,0.01
2,7.4,"2001",359.0,0.004
2,7.4,"117",370.0,0.004
3,5.3,"1117",8.0,0.127
4,6.1,"1438",16.1,0.411
4,6.1,"1083",63.6,0.018
4,6.1,"1013",6.6,0.509
4,6.1,"1014",9.3,0.467
4,6.1,"1015",13.0,0.279
4,6.1,"1016",17.3,0.072
4,6.1,"1095",105.0,0.012
4,6.1,"1011",112.0,0.006
4,6.1,"1028",123.0,0.003
5,6.6,"270",105.0,0.018
5,6.6,"280",122.0,0.048
5,6.6,"116",141.0,0.011
5,6.6,"266",200.0,0.007
5,6.6,"117",45.0,0.142
5,6.6,"113",130.0,0.031
5,6.6,"112",147.0,0.006
5,6.6,"130",187.0,0.01
5,6.6,"475",197.0,0.01
5,6.6,"269",203.0,0.006
5,6.6,"135",211.0,0.013
6,5.6,"1093",62.0,0.005
7,5.7,"1093",62.0,0.003
8,5.3,"111",19.0,0.086
8,5.3,"116",21.0,0.179
8,5.3,"290",13.0,0.205
8,5.3,"112",22.0,0.073
8,5.3,"113",29.0,0.045
9,6.6,"128",17.0,0.374
9,6.6,"126",19.6,0.2
9,6.6,"127",20.2,0.147
9,6.6,"141",21.1,0.188
9,6.6,"266",21.9,0.204
9,6.6,"110",24.2,0.335
9,6.6,"1027",66.0,0.057
9,6.6,"111",87.0,0.021
9,6.6,"125",23.4,0.152
9,6.6,"135",24.6,0.217
9,6.6,"475",25.7,0.114
9,6.6,"262",28.6,0.15
9,6.6,"269",37.4,0.148
9,6.6,"1052",46.7,0.112
9,6.6,"411",56.9,0.043
9,6.6,"290",60.7,0.057
9,6.6,"130",61.4,0.03
9,6.6,"272",62.0,0.027
9,6.6,"1096",64.0,0.028
9,6.6,"1102",82.0,0.034
9,6.6,"112",88.0,0.03
9,6.6,"113",91.0,0.039
10,5.3,"1028",31.0,0.03
11,7.7,"2714",45.0,0.11
11,7.7,"2708",145.0,0.01
11,7.7,"2715",300.0,0.01
12,6.2,"3501",5.0,0.39
13,5.6,"655",50.0,0.031
13,5.6,"272",16.0,0.13
14,5.2,"1032",17.0,0.011
14,5.2,"1377",8.0,0.12
14,5.2,"1028",10.0,0.17
14,5.2,"1250",10.0,0.14
15,6.0,"1051",8.0,0.11
15,6.0,"1293",32.0,0.04
15,6.0,"1291",30.0,0.07
15,6.0,"1292",31.0,0.08
16,5.1,"283",2.9,0.21
16,5.1,"885",3.2,0.39
16,5.1,"NA",7.6,0.28
17,7.6,"2734",25.4,0.16
17,7.6,"NA",32.9,0.064
17,7.6,"2728",92.2,0.09
18,5.8,"1413",1.2,0.42
18,5.8,"1445",1.6,0.23
18,5.8,"1408",9.1,0.13
18,5.8,"1411",3.7,0.26
18,5.8,"1410",5.3,0.27
18,5.8,"1409",7.4,0.26
18,5.8,"1377",17.9,0.11
18,5.8,"1492",19.2,0.12
18,5.8,"1251",23.4,0.038
18,5.8,"1422",30.0,0.044
18,5.8,"1376",38.9,0.046
19,6.5,"NA",23.5,0.17
19,6.5,"286",26.0,0.21
19,6.5,"NA",0.5,0.32
19,6.5,"5028",0.6,0.52
19,6.5,"942",1.3,0.72
19,6.5,"NA",1.4,0.32
19,6.5,"5054",2.6,0.81
19,6.5,"958",3.8,0.64
19,6.5,"952",4.0,0.56
19,6.5,"5165",5.1,0.51
19,6.5,"117",6.2,0.4
19,6.5,"955",6.8,0.61
19,6.5,"5055",7.5,0.26
19,6.5,"NA",7.6,0.24
19,6.5,"NA",8.4,0.46
19,6.5,"5060",8.5,0.22
19,6.5,"412",8.5,0.23
19,6.5,"5053",10.6,0.28
19,6.5,"5058",12.6,0.38
19,6.5,"5057",12.7,0.27
19,6.5,"NA",12.9,0.31
19,6.5,"5051",14.0,0.2
19,6.5,"NA",15.0,0.11
19,6.5,"5115",16.0,0.43
19,6.5,"NA",17.7,0.27
19,6.5,"931",18.0,0.15
19,6.5,"5056",22.0,0.15
19,6.5,"5059",22.0,0.15
19,6.5,"5061",23.0,0.13
19,6.5,"NA",23.2,0.19
19,6.5,"5062",29.0,0.13
19,6.5,"5052",32.0,0.066
19,6.5,"NA",32.7,0.35
19,6.5,"724",36.0,0.1
19,6.5,"NA",43.5,0.16
19,6.5,"5066",49.0,0.14
19,6.5,"5050",60.0,0.049
19,6.5,"2316",64.0,0.034
20,5.0,"5055",7.5,0.264
20,5.0,"942",8.8,0.263
20,5.0,"5028",8.9,0.23
20,5.0,"5165",9.4,0.147
20,5.0,"952",9.7,0.286
20,5.0,"958",9.7,0.157
20,5.0,"955",10.5,0.237
20,5.0,"117",10.5,0.133
20,5.0,"412",12.0,0.055
20,5.0,"5053",12.2,0.097
20,5.0,"5054",12.8,0.129
20,5.0,"5058",14.6,0.192
20,5.0,"5057",14.9,0.147
20,5.0,"5115",17.6,0.154
20,5.0,"5056",23.9,0.06
20,5.0,"5060",25.0,0.057
21,5.8,"1030",10.8,0.12
21,5.8,"1418",15.7,0.154
21,5.8,"1383",16.7,0.052
21,5.8,"1308",20.8,0.045
21,5.8,"1298",28.5,0.086
21,5.8,"1299",33.1,0.056
21,5.8,"1219",40.3,0.065
22,5.5,"NA",4.0,0.259
22,5.5,"NA",10.1,0.267
22,5.5,"1030",11.1,0.071
22,5.5,"1418",17.7,0.275
22,5.5,"1383",22.5,0.058
22,5.5,"NA",26.5,0.026
22,5.5,"1299",29.0,0.039
22,5.5,"1308",30.9,0.112
22,5.5,"1219",37.8,0.065
22,5.5,"1456",48.3,0.026
23,5.3,"5045",5.8,0.123
23,5.3,"5044",12.0,0.133
23,5.3,"5160",12.1,0.073
23,5.3,"5043",20.5,0.097
23,5.3,"5047",20.5,0.096
23,5.3,"c168",25.3,0.23
23,5.3,"5068",35.9,0.082
23,5.3,"c118",36.1,0.11
23,5.3,"5042",36.3,0.11
23,5.3,"5067",38.5,0.094
23,5.3,"5049",41.4,0.04
23,5.3,"c204",43.6,0.05
23,5.3,"5070",44.4,0.022
23,5.3,"c266",46.1,0.07
23,5.3,"c203",47.1,0.08
23,5.3,"5069",47.7,0.033
23,5.3,"5073",49.2,0.017
23,5.3,"5072",53.1,0.022

0 comments on commit 4ca1926

Please sign in to comment.