()
| 66 | |
| 67 | #[tokio::test] |
| 68 | async fn copy_json_array_roundtrip() { |
| 69 | let srv = TestServer::start().await; |
| 70 | |
| 71 | srv.exec("CREATE COLLECTION copy_json_arr_test (id INT, name TEXT, score FLOAT)") |
| 72 | .await |
| 73 | .expect("CREATE COLLECTION"); |
| 74 | |
| 75 | let json = r#"[ |
| 76 | {"id": 1, "name": "alice", "score": 9.5}, |
| 77 | {"id": 2, "name": "bob", "score": 8.1}, |
| 78 | {"id": 3, "name": "carol", "score": 7.7}, |
| 79 | {"id": 4, "name": "dave", "score": 6.2}, |
| 80 | {"id": 5, "name": "eve", "score": 5.0} |
| 81 | ]"#; |
| 82 | let f = write_temp(json, ".json"); |
| 83 | let path = f.path().to_string_lossy().to_string(); |
| 84 | |
| 85 | srv.exec(&format!("COPY copy_json_arr_test FROM '{path}'")) |
| 86 | .await |
| 87 | .expect("COPY JSON array"); |
| 88 | |
| 89 | assert_eq!(count_rows(&srv, "copy_json_arr_test").await, 5); |
| 90 | } |
| 91 | |
| 92 | // ── test 3: CSV import with header row ────────────────────────────────────── |
| 93 |
nothing calls this directly
no test coverage detected