diff options
Diffstat (limited to 'mingling_pathf/test/src/test_files')
| -rw-r--r-- | mingling_pathf/test/src/test_files/test_dispatcher_clap.rs | 40 | ||||
| -rw-r--r-- | mingling_pathf/test/src/test_files/test_groupped_derive.rs | 17 |
2 files changed, 57 insertions, 0 deletions
diff --git a/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs b/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs index 0ba884d..33d86e0 100644 --- a/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs +++ b/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs @@ -1,3 +1,4 @@ +// Basic: entry type only (no CMD type specified) #[mingling::macros::dispatcher_clap] struct EntryClap1 { name: String, @@ -20,6 +21,30 @@ pub struct EntryClap4 { value: i32, } +// With CMD type +#[dispatcher_clap("greet", CMDGreet)] +struct EntryWithCmd { + name: String, +} + +// With CMD + error +#[dispatcher_clap("delete", CMDDelete, error = ErrorDelete)] +struct EntryWithError { + id: u64, +} + +// With CMD + help +#[dispatcher_clap("helpcmd", CMDHelp, help = true)] +struct EntryWithHelp { + verbose: bool, +} + +// With CMD + error + help +#[dispatcher_clap("full", CMDFull, error = ErrorFull, help = true)] +struct EntryFull { + all: bool, +} + pub mod sub { #[mingling::macros::dispatcher_clap] struct EntryClap1 { @@ -30,4 +55,19 @@ pub mod sub { struct EntryClap3 { value: String, } + + #[dispatcher_clap("greet", CMDGreet)] + struct EntryWithCmd { + name: String, + } + + #[dispatcher_clap("delete", CMDDelete, error = ErrorDelete)] + struct EntryWithError { + id: u64, + } + + #[dispatcher_clap("helpcmd", CMDHelp, help = true)] + struct EntryWithHelp { + verbose: bool, + } } diff --git a/mingling_pathf/test/src/test_files/test_groupped_derive.rs b/mingling_pathf/test/src/test_files/test_groupped_derive.rs index f6c6fa9..913587c 100644 --- a/mingling_pathf/test/src/test_files/test_groupped_derive.rs +++ b/mingling_pathf/test/src/test_files/test_groupped_derive.rs @@ -13,6 +13,18 @@ struct Derived3 { value: bool, } +#[derive(Groupped)] +enum EnumDerived1 { + A, + B, +} + +#[derive(GrouppedSerialize)] +enum EnumDerived2 { + X(String), + Y(i32), +} + pub mod sub { #[derive(Groupped)] struct Derived1 { @@ -23,4 +35,9 @@ pub mod sub { struct Derived3 { value: bool, } + + #[derive(Groupped)] + enum EnumDerived1 { + A, + } } |
