()
| 93 | |
| 94 | #[tokio::test] |
| 95 | async fn copy_csv_with_header() { |
| 96 | let srv = TestServer::start().await; |
| 97 | |
| 98 | srv.exec("CREATE COLLECTION copy_csv_test (id INT, name TEXT, score FLOAT)") |
| 99 | .await |
| 100 | .expect("CREATE COLLECTION"); |
| 101 | |
| 102 | let csv = "id,name,score\n1,alice,9.5\n2,bob,8.1\n3,carol,7.7\n4,dave,6.2\n5,eve,5.0\n"; |
| 103 | let f = write_temp(csv, ".csv"); |
| 104 | let path = f.path().to_string_lossy().to_string(); |
| 105 | |
| 106 | srv.exec(&format!("COPY copy_csv_test FROM '{path}'")) |
| 107 | .await |
| 108 | .expect("COPY CSV"); |
| 109 | |
| 110 | assert_eq!(count_rows(&srv, "copy_csv_test").await, 5); |
| 111 | } |
| 112 | |
| 113 | // ── test 4: auto-detect extension ──────────────────────────────────────────── |
| 114 |
nothing calls this directly
no test coverage detected