test: Ensure the parser supports lines with a field but no time
@@ -1197,6 +1197,19 @@ her"#,
Ok(())
}
+ #[test]
+ fn parse_measurement_but_no_time() -> Result {
+ let input = "m0,tag0=value1 v0=1";
+ let vals = parse(input)?;
+
+ assert_eq!(vals[0].series(), "m0,tag0=value1\tv0");
+ // Just test that we haven't traveled back in time
+ assert!(vals[0].time() > 1_583_443_428_970_606_000);
+ assert!(approximately_equal(vals[0].f64_value().unwrap(), 1.0));
+
+ Ok(())
+ }
+
#[test]
fn index_pairs() {
let p = Point {
