Fix time serialization in v2 encoder

This commit is contained in:
Marcin Kulik
2025-03-31 10:56:53 +02:00
parent 287daeda31
commit dc2444453f
2 changed files with 26 additions and 4 deletions

View File

@@ -251,7 +251,7 @@ mod tests {
let mut enc = Encoder::new(0);
data.extend(enc.header(&header));
data.extend(enc.event(&Event::output(1000001, "hello\r\n".to_owned())));
data.extend(enc.event(&Event::output(1000000, "hello\r\n".to_owned())));
let mut enc = Encoder::new(1000001);
data.extend(enc.event(&Event::output(1000001, "world".to_owned())));
@@ -265,7 +265,7 @@ mod tests {
assert_eq!(lines[0]["width"], 80);
assert_eq!(lines[0]["height"], 24);
assert!(lines[0]["timestamp"].is_null());
assert_eq!(lines[1][0], 1.000001);
assert_eq!(lines[1][0], 1.000000);
assert_eq!(lines[1][1], "o");
assert_eq!(lines[1][2], "hello\r\n");
assert_eq!(lines[2][0], 2.000002);