refactor: capture test output

pull/24376/head
Nga Tran 2021-06-09 15:09:13 -04:00
parent 8cc99e3420
commit 4478d900ee
1 changed files with 37 additions and 37 deletions

View File

@ -676,15 +676,15 @@ mod test {
let batch = collect(Arc::clone(&input)).await.unwrap();
// data in its original non-sorted form
let expected = vec![
"+------+-----------+-------------------------------+",
"| tag1 | field_int | time |",
"+------+-----------+-------------------------------+",
"| MT | 1000 | 1970-01-01 00:00:00.000001 |",
"| MT | 10 | 1970-01-01 00:00:00.000007 |",
"| CT | 70 | 1970-01-01 00:00:00.000000100 |",
"| AL | 100 | 1970-01-01 00:00:00.000000050 |",
"| MT | 5 | 1970-01-01 00:00:00.000005 |",
"+------+-----------+-------------------------------+",
"+-----------+------+-------------------------------+",
"| field_int | tag1 | time |",
"+-----------+------+-------------------------------+",
"| 1000 | MT | 1970-01-01 00:00:00.000001 |",
"| 10 | MT | 1970-01-01 00:00:00.000007 |",
"| 70 | CT | 1970-01-01 00:00:00.000000100 |",
"| 100 | AL | 1970-01-01 00:00:00.000000050 |",
"| 5 | MT | 1970-01-01 00:00:00.000005 |",
"+-----------+------+-------------------------------+",
];
assert_batches_eq!(&expected, &batch);
@ -693,15 +693,15 @@ mod test {
let batch = collect(sort_plan.unwrap()).await.unwrap();
// data is not sorted on primary key(tag1, tag2, time)
let expected = vec![
"+------+-----------+-------------------------------+",
"| tag1 | field_int | time |",
"+------+-----------+-------------------------------+",
"| AL | 100 | 1970-01-01 00:00:00.000000050 |",
"| CT | 70 | 1970-01-01 00:00:00.000000100 |",
"| MT | 1000 | 1970-01-01 00:00:00.000001 |",
"| MT | 5 | 1970-01-01 00:00:00.000005 |",
"| MT | 10 | 1970-01-01 00:00:00.000007 |",
"+------+-----------+-------------------------------+",
"+-----------+------+-------------------------------+",
"| field_int | tag1 | time |",
"+-----------+------+-------------------------------+",
"| 100 | AL | 1970-01-01 00:00:00.000000050 |",
"| 70 | CT | 1970-01-01 00:00:00.000000100 |",
"| 1000 | MT | 1970-01-01 00:00:00.000001 |",
"| 5 | MT | 1970-01-01 00:00:00.000005 |",
"| 10 | MT | 1970-01-01 00:00:00.000007 |",
"+-----------+------+-------------------------------+",
];
assert_batches_eq!(&expected, &batch);
}
@ -711,10 +711,10 @@ mod test {
// Chunk 1 with 5 rows of data
let chunk = Arc::new(
TestChunk::new(1)
.with_time_column("t")
.with_tag_column("t", "tag1")
.with_tag_column("t", "tag2")
.with_int_field_column("t", "field_int")
.with_time_column("t")
.with_five_rows_of_data("t"),
);
@ -731,15 +731,15 @@ mod test {
let batch = collect(Arc::clone(&input)).await.unwrap();
// data in its original non-sorted form
let expected = vec![
"+------+------+-----------+-------------------------------+",
"| tag1 | tag2 | field_int | time |",
"+------+------+-----------+-------------------------------+",
"| MT | CT | 1000 | 1970-01-01 00:00:00.000001 |",
"| MT | AL | 10 | 1970-01-01 00:00:00.000007 |",
"| CT | CT | 70 | 1970-01-01 00:00:00.000000100 |",
"| AL | MA | 100 | 1970-01-01 00:00:00.000000050 |",
"| MT | AL | 5 | 1970-01-01 00:00:00.000005 |",
"+------+------+-----------+-------------------------------+",
"+-----------+------+------+-------------------------------+",
"| field_int | tag1 | tag2 | time |",
"+-----------+------+------+-------------------------------+",
"| 1000 | MT | CT | 1970-01-01 00:00:00.000001 |",
"| 10 | MT | AL | 1970-01-01 00:00:00.000007 |",
"| 70 | CT | CT | 1970-01-01 00:00:00.000000100 |",
"| 100 | AL | MA | 1970-01-01 00:00:00.000000050 |",
"| 5 | MT | AL | 1970-01-01 00:00:00.000005 |",
"+-----------+------+------+-------------------------------+",
];
assert_batches_eq!(&expected, &batch);
@ -748,15 +748,15 @@ mod test {
let batch = collect(sort_plan.unwrap()).await.unwrap();
// data is not sorted on primary key(tag1, tag2, time)
let expected = vec![
"+------+------+-----------+-------------------------------+",
"| tag1 | tag2 | field_int | time |",
"+------+------+-----------+-------------------------------+",
"| AL | MA | 100 | 1970-01-01 00:00:00.000000050 |",
"| CT | CT | 70 | 1970-01-01 00:00:00.000000100 |",
"| MT | AL | 5 | 1970-01-01 00:00:00.000005 |",
"| MT | AL | 10 | 1970-01-01 00:00:00.000007 |",
"| MT | CT | 1000 | 1970-01-01 00:00:00.000001 |",
"+------+------+-----------+-------------------------------+",
"+-----------+------+------+-------------------------------+",
"| field_int | tag1 | tag2 | time |",
"+-----------+------+------+-------------------------------+",
"| 100 | AL | MA | 1970-01-01 00:00:00.000000050 |",
"| 70 | CT | CT | 1970-01-01 00:00:00.000000100 |",
"| 5 | MT | AL | 1970-01-01 00:00:00.000005 |",
"| 10 | MT | AL | 1970-01-01 00:00:00.000007 |",
"| 1000 | MT | CT | 1970-01-01 00:00:00.000001 |",
"+-----------+------+------+-------------------------------+",
];
assert_batches_eq!(&expected, &batch);
}