@@ -54,22 +54,22 @@ func TestParseHistoricDataset(t *testing.T) {
54
54
}
55
55
56
56
func TestParseStandardDataset (t * testing.T ) {
57
- frame := "OPTARIF \t BASE \t 0 "
57
+ frame := "ADCO \t 021528603314 \t # "
58
58
dataset , err := parseStandardDataset (frame )
59
59
if err != nil {
60
60
t .Errorf ("Unexpected error: %s" , err )
61
61
}
62
62
63
- if dataset .Label != "OPTARIF " {
64
- t .Errorf ("Expected label OPTARIF , got %s" , dataset .Label )
63
+ if dataset .Label != "ADCO " {
64
+ t .Errorf ("Expected label ADCO , got %s" , dataset .Label )
65
65
}
66
66
67
- if dataset .Data != "BASE " {
68
- t .Errorf ("Expected data BASE , got %s" , dataset .Data )
67
+ if dataset .Data != "021528603314 " {
68
+ t .Errorf ("Expected data 021528603314 , got %s" , dataset .Data )
69
69
}
70
70
71
71
if dataset .Valid != true {
72
- t .Errorf ("Checksum invalid: %s" , dataset .Checksum )
72
+ t .Errorf ("Checksum invalid, got %s" , dataset .Checksum )
73
73
}
74
74
}
75
75
@@ -80,13 +80,14 @@ func TestCalculateChecksum(t *testing.T) {
80
80
}{
81
81
{"IINST 002" , "Y" }, // historical format
82
82
{"IMAX 090" , "H" },
83
- {"IINST\t 002" , "B" }, // standard format
83
+ {"IINST\t 002" , "B" }, // standard format sans horodatage
84
+ {"ADCO\t 021528603314" , "#" },
84
85
}
85
86
86
87
for _ , test := range tests {
87
88
result := calculateChecksum (test .input )
88
89
if string (result ) != test .expected {
89
- t .Errorf ("calculateChecksum(%q) = %s; expected %X " , test .input , string (result ), test .expected )
90
+ t .Errorf ("calculateChecksum(%q) = %s; expected %s " , test .input , string (result ), test .expected )
90
91
}
91
92
}
92
93
}
0 commit comments