in azure-kusto-ingest/src/ingestion_blob_info.rs [99:118]
fn time_custom_iso8601_serialization() {
#[derive(Serialize, Debug)]
struct TestTimeSerialize {
#[serde(with = "kusto_ingest_iso8601_format")]
customised_time_format: time::OffsetDateTime,
}
let test_message = TestTimeSerialize {
customised_time_format: time::OffsetDateTime::from_unix_timestamp_nanos(
1_234_567_890_123_456_789,
)
.unwrap(),
};
let serialized_message = serde_json::to_string(&test_message).unwrap();
assert_eq!(
serialized_message,
"{\"customised_time_format\":\"2009-02-13T23:31:30.123456789Z\"}"
);
}