MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / run_workspace_parsing

Function run_workspace_parsing

parser/tests/workspace_tests.rs:6–31  ·  view source on GitHub ↗
(
    root_dir: &str,
    workspace_expected: Workspace,
)

Source from the content-addressed store, hash-verified

4pub use pretty_assertions::assert_eq;
5
6async fn run_workspace_parsing(
7 root_dir: &str,
8 workspace_expected: Workspace,
9) -> anyhow::Result<Workspace> {
10 let workspace = parse_workspace(root_dir)?;
11
12 println!("{:#?}", workspace);
13
14 let firedbg_dir = format!("{root_dir}/firedbg");
15
16 std::fs::create_dir_all(&firedbg_dir)?;
17
18 let bson_path = format!("{firedbg_dir}/workspace");
19
20 serde::to_bson_file(&format!("{bson_path}.bson"), &workspace).await?;
21 serde::to_json_file(&format!("{bson_path}.json"), &workspace).await?;
22
23 assert_eq!(
24 workspace_expected,
25 serde::from_bson_file(&format!("{}.bson", bson_path)).await?,
26 );
27
28 assert_eq!(workspace_expected, workspace);
29
30 Ok(workspace)
31}
32
33#[tokio::test]
34async fn parse_example_workspace() -> anyhow::Result<()> {

Callers 3

parse_example_workspaceFunction · 0.85
parse_sea_streamerFunction · 0.85

Calls 3

to_bson_fileFunction · 0.85
to_json_fileFunction · 0.85
parse_workspaceFunction · 0.50

Tested by

no test coverage detected