about summary refs log tree commit diff
path: root/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests.rs')
-rw-r--r--src/tests.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tests.rs b/src/tests.rs
index 623cb6b59981..6840602eca55 100644
--- a/src/tests.rs
+++ b/src/tests.rs
@@ -5,6 +5,7 @@ use serde_json::to_string;
 fn test_text_entry_serialization() {
     let entry = LogEntry {
         labels: Value::Null,
+        timestamp: None,
         payload: Payload::TextPayload {
             text_payload: "test entry".into(),
         }
@@ -20,6 +21,7 @@ fn test_text_entry_serialization() {
 fn test_json_entry_serialization() {
     let entry = LogEntry {
         labels: Value::Null,
+        timestamp: None,
         payload: Payload::TextPayload {
             text_payload: "test entry".into(),
         }
@@ -78,3 +80,12 @@ fn test_json_no_object() {
 
     assert_eq!(expected, payload, "Non-object JSON payload should be plain text");
 }
+
+#[test]
+fn test_parse_microseconds() {
+    let input: String = "1529175149291187".into();
+    let expected: DateTime<Utc> = "2018-06-16T18:52:29.291187Z"
+        .to_string().parse().unwrap();
+
+    assert_eq!(Some(expected), parse_microseconds(input));
+}