Commit b1eccb7 1 parent f6a2327 commit b1eccb7 Copy full SHA for b1eccb7
File tree 3 files changed +18
-2
lines changed
3 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
@@ -802,4 +803,19 @@ mod tests {
802
803
803
804
println ! ( "{footprints:#?}" ) ;
804
805
}
806
+
807
+ #[ test]
808
+ fn test_deser_energyconsumptionunit ( ) {
809
+ use EnergyConsumptionUnit :: * ;
810
+ let test_vectors = vec ! [
811
+ ( "\" l\" " , L ) ,
812
+ ( "\" kg\" " , Kg ) ,
813
+ ( "\" kWh\" " , KWh ) ,
814
+ ( "\" MJ\" " , MJ ) ,
815
+ ] ;
816
+
817
+ for ( expect, input) in & test_vectors {
818
+ assert_eq ! ( expect, & serde_json:: to_string( input) . unwrap( ) ) ;
819
+ }
820
+ }
805
821
}
You can’t perform that action at this time.
0 commit comments