From b3e8030c112b3723c602b7b1cf881565617d0a67 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Fri, 23 Jun 2023 22:23:19 +0200 Subject: [PATCH] chore: move macro doctests to separate folder --- crates/sol-macro/doctests | 2 +- crates/sol-macro/src/lib.rs | 10 +++++----- crates/sol-types/tests/doctests.rs | 7 +++++++ .../tests/{doc_contracts.rs => doctests/contracts.rs} | 0 .../tests/{doc_events.rs => doctests/events.rs} | 0 .../function_like.rs} | 0 .../tests/{doc_structs.rs => doctests/structs.rs} | 0 .../tests/{doc_types.rs => doctests/types.rs} | 0 8 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 crates/sol-types/tests/doctests.rs rename crates/sol-types/tests/{doc_contracts.rs => doctests/contracts.rs} (100%) rename crates/sol-types/tests/{doc_events.rs => doctests/events.rs} (100%) rename crates/sol-types/tests/{doc_function_like.rs => doctests/function_like.rs} (100%) rename crates/sol-types/tests/{doc_structs.rs => doctests/structs.rs} (100%) rename crates/sol-types/tests/{doc_types.rs => doctests/types.rs} (100%) diff --git a/crates/sol-macro/doctests b/crates/sol-macro/doctests index c08e0cbdf..777b79669 120000 --- a/crates/sol-macro/doctests +++ b/crates/sol-macro/doctests @@ -1 +1 @@ -../sol-types/tests/ \ No newline at end of file +../sol-types/tests/doctests \ No newline at end of file diff --git a/crates/sol-macro/src/lib.rs b/crates/sol-macro/src/lib.rs index 706403ef0..0addc11f8 100644 --- a/crates/sol-macro/src/lib.rs +++ b/crates/sol-macro/src/lib.rs @@ -41,27 +41,27 @@ mod utils; /// /// ## Structs and enums /// ```ignore -#[doc = include_str!("../doctests/doc_structs.rs")] +#[doc = include_str!("../doctests/structs.rs")] /// ``` /// /// ## UDVT and type aliases /// ```ignore -#[doc = include_str!("../doctests/doc_types.rs")] +#[doc = include_str!("../doctests/types.rs")] /// ``` /// /// ## Functions and errors /// ```ignore -#[doc = include_str!("../doctests/doc_function_like.rs")] +#[doc = include_str!("../doctests/function_like.rs")] /// ``` /// /// ## Events /// ```ignore -#[doc = include_str!("../doctests/doc_events.rs")] +#[doc = include_str!("../doctests/events.rs")] /// ``` /// /// ## Contracts/interfaces /// ```ignore -#[doc = include_str!("../doctests/doc_contracts.rs")] +#[doc = include_str!("../doctests/contracts.rs")] /// ``` #[proc_macro] pub fn sol(input: TokenStream) -> TokenStream { diff --git a/crates/sol-types/tests/doctests.rs b/crates/sol-types/tests/doctests.rs new file mode 100644 index 000000000..24cb3f7de --- /dev/null +++ b/crates/sol-types/tests/doctests.rs @@ -0,0 +1,7 @@ +mod doctests { + mod contracts; + mod events; + mod function_like; + mod structs; + mod types; +} diff --git a/crates/sol-types/tests/doc_contracts.rs b/crates/sol-types/tests/doctests/contracts.rs similarity index 100% rename from crates/sol-types/tests/doc_contracts.rs rename to crates/sol-types/tests/doctests/contracts.rs diff --git a/crates/sol-types/tests/doc_events.rs b/crates/sol-types/tests/doctests/events.rs similarity index 100% rename from crates/sol-types/tests/doc_events.rs rename to crates/sol-types/tests/doctests/events.rs diff --git a/crates/sol-types/tests/doc_function_like.rs b/crates/sol-types/tests/doctests/function_like.rs similarity index 100% rename from crates/sol-types/tests/doc_function_like.rs rename to crates/sol-types/tests/doctests/function_like.rs diff --git a/crates/sol-types/tests/doc_structs.rs b/crates/sol-types/tests/doctests/structs.rs similarity index 100% rename from crates/sol-types/tests/doc_structs.rs rename to crates/sol-types/tests/doctests/structs.rs diff --git a/crates/sol-types/tests/doc_types.rs b/crates/sol-types/tests/doctests/types.rs similarity index 100% rename from crates/sol-types/tests/doc_types.rs rename to crates/sol-types/tests/doctests/types.rs