MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / copy_to_json_array_basic

Function copy_to_json_array_basic

nodedb/tests/sql_copy_to.rs:91–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89
90#[tokio::test]
91async 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

Callers

nothing calls this directly

Calls 4

seed_collectionFunction · 0.85
temp_output_pathFunction · 0.85
expectMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected