jnioche / carbonintensity-api

A simple Rust library to retrieve data from https://api.carbonintensity.org.uk/
Apache License 2.0
10 stars 1 forks source link

Add some tests for the date handling logic #18

Closed xoen closed 1 month ago

xoen commented 1 month ago

Added some tests for the internal utility functions used to handle dates:

These would have prevented this glitch earlier :)

I've also made some small refactoring after introducing these tests:

This should resolve Issue #14

xoen commented 1 month ago

I know it's kinda cosmetic but maybe it's worth deciding on what to do in regards of the American vs. British spelling before introducing more inconsistencies :)

For example here I've named one of the tests deserialize_power_data_test() with a z 😬

xoen commented 1 month ago

FYI: I've tweaked the spelling.

jnioche commented 1 month ago

thanks @xoen