Skip to content

Commit

Permalink
ci: add test for multi-page result. (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun authored Apr 22, 2024
1 parent d138d4f commit f580aee
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions driver/tests/driver/select_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,23 @@ async fn select_numbers() {
assert_eq!(ret, vec![0, 1, 2, 3, 4]);
}

#[tokio::test]
async fn select_multi_page() {
let (conn, _) = prepare("select_multi_page").await;
// default page size is 10000
let n = 46000;
let sql = format!("select * from NUMBERS({n}) order by number");
let rows = conn.query_iter(&sql).await.unwrap();
let ret: Vec<u64> = rows
.map(|r| r.unwrap().try_into().unwrap())
.collect::<Vec<(u64,)>>()
.await
.into_iter()
.map(|r| r.0)
.collect();
assert_eq!(ret, (0..n).collect::<Vec<u64>>());
}

#[tokio::test]
async fn select_sleep() {
let (conn, _) = prepare("select_sleep").await;
Expand Down

0 comments on commit f580aee

Please sign in to comment.