File tree 4 files changed +18
-2
lines changed
4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 178
178
" l" ,
179
179
" kg" ,
180
180
" kWh" ,
181
- " mJ "
181
+ " MJ "
182
182
]
183
183
},
184
184
"Feedstock" : {
Original file line number Diff line number Diff line change 189
189
" l" ,
190
190
" kg" ,
191
191
" kWh" ,
192
- " mJ "
192
+ " MJ "
193
193
]
194
194
},
195
195
"Feedstock" : {
Original file line number Diff line number Diff line change @@ -355,6 +355,7 @@ pub enum EnergyConsumptionUnit {
355
355
L ,
356
356
Kg ,
357
357
KWh ,
358
+ #[ serde( rename = "MJ" ) ]
358
359
MJ ,
359
360
}
360
361
Original file line number Diff line number Diff line change @@ -127,3 +127,18 @@ fn test_ship_foot_deser() {
127
127
let ship_foot: ShipmentFootprint = serde_json:: from_str ( json) . unwrap ( ) ;
128
128
assert_eq ! ( ship_foot, expected)
129
129
}
130
+
131
+ #[ test]
132
+ fn test_energyconsumptionunit_deser ( ) {
133
+ use EnergyConsumptionUnit :: * ;
134
+ let test_vectors = vec ! [
135
+ ( "\" l\" " , L ) ,
136
+ ( "\" kg\" " , Kg ) ,
137
+ ( "\" kWh\" " , KWh ) ,
138
+ ( "\" MJ\" " , MJ ) ,
139
+ ] ;
140
+
141
+ for ( expect, input) in & test_vectors {
142
+ assert_eq ! ( expect, & serde_json:: to_string( input) . unwrap( ) ) ;
143
+ }
144
+ }
You can’t perform that action at this time.
0 commit comments