From 591b5ed3820203c24e6eb4f1746574147fdac347 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 7 Oct 2023 01:13:26 -0400 Subject: [PATCH] Starting to define a TestConfig enum. --- src/bin_foreign_document_test.rs | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/bin_foreign_document_test.rs b/src/bin_foreign_document_test.rs index 414c448..0fb77ef 100644 --- a/src/bin_foreign_document_test.rs +++ b/src/bin_foreign_document_test.rs @@ -16,7 +16,7 @@ mod init_tracing; fn main() -> Result<(), Box> { let rt = tokio::runtime::Runtime::new()?; let result = rt.block_on(async { - let main_body_result = main_body(); + let main_body_result = main_body().await; main_body_result }); result @@ -27,7 +27,7 @@ fn main() -> Result<(), Box> { let rt = tokio::runtime::Runtime::new()?; let result = rt.block_on(async { init_telemetry()?; - let main_body_result = main_body(); + let main_body_result = main_body().await; shutdown_telemetry()?; main_body_result }); @@ -35,7 +35,7 @@ fn main() -> Result<(), Box> { } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn main_body() -> Result<(), Box> { +async fn main_body() -> Result<(), Box> { let args = std::env::args().skip(1); if args.is_empty() { let org_contents = read_stdin_to_string()?; @@ -55,3 +55,25 @@ fn read_stdin_to_string() -> Result> { .read_to_string(&mut stdin_contents)?; Ok(stdin_contents) } + +#[derive(Debug)] +enum TestConfig<'s> { + TestLayer(TestLayer<'s>), + SingleFile(SingleFile<'s>), + AnonymousFile(AnonymousFile), +} + +#[derive(Debug)] +struct TestLayer<'s> { + name: &'s str, +} + +#[derive(Debug)] +struct SingleFile<'s> { + name: &'s str, +} + +#[derive(Debug)] +struct AnonymousFile<'s> { + name: String, +}