Skip to content

Commit 09945f3

Browse files
committed
(test) add test for batch query
1 parent d43101b commit 09945f3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

influxdb/src/query/write_query.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,25 @@ mod tests {
340340
r#"wea\,\ ther=,location=us-midwest,loc\,\ \="ation=us\,\ \"mid\=west temperature=82i,"temp\=era\,t\ ure"="too\"\\\\hot",float=82 11"#
341341
);
342342
}
343+
344+
#[test]
345+
fn test_batch() {
346+
let q0 = Timestamp::Hours(11)
347+
.into_query("weather")
348+
.add_field("temperature", 82)
349+
.add_tag("location", "us-midwest");
350+
351+
let q1 = Timestamp::Hours(12)
352+
.into_query("weather")
353+
.add_field("temperature", 65)
354+
.add_tag("location", "us-midwest");
355+
356+
let query = vec![q0, q1].build();
357+
358+
assert_eq!(
359+
query.unwrap().get(),
360+
r#"weather,location=us-midwest temperature=82i 11
361+
weather,location=us-midwest temperature=65i 12"#
362+
);
363+
}
343364
}

0 commit comments

Comments
 (0)