(
root_dir: &str,
workspace_expected: Workspace,
)
| 4 | pub use pretty_assertions::assert_eq; |
| 5 | |
| 6 | async 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] |
| 34 | async fn parse_example_workspace() -> anyhow::Result<()> { |
no test coverage detected