()
| 89 | |
| 90 | #[tokio::test] |
| 91 | async fn copy_to_json_array_basic() { |
| 92 | let srv = TestServer::start().await; |
| 93 | |
| 94 | seed_collection(&srv, "copy_to_json").await; |
| 95 | |
| 96 | let (_dir, out_path) = temp_output_path(".json"); |
| 97 | srv.exec(&format!("COPY copy_to_json TO '{out_path}'")) |
| 98 | .await |
| 99 | .expect("COPY TO JSON"); |
| 100 | |
| 101 | let content = std::fs::read_to_string(&out_path).expect("read output file"); |
| 102 | let arr: serde_json::Value = |
| 103 | serde_json::from_str(&content).unwrap_or_else(|e| panic!("invalid JSON: {e}")); |
| 104 | assert!(arr.is_array(), "expected JSON array output"); |
| 105 | assert_eq!(arr.as_array().unwrap().len(), 3); |
| 106 | } |
| 107 | |
| 108 | // ── test 3: CSV with header ────────────────────────────────────────────────── |
| 109 |
nothing calls this directly
no test coverage detected