aboutsummaryrefslogtreecommitdiff
path: root/mingling_pathf/test/src/test_files
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_pathf/test/src/test_files')
-rw-r--r--mingling_pathf/test/src/test_files/test_chain.rs61
-rw-r--r--mingling_pathf/test/src/test_files/test_completion.rs41
-rw-r--r--mingling_pathf/test/src/test_files/test_dispatcher.rs17
-rw-r--r--mingling_pathf/test/src/test_files/test_dispatcher_clap.rs33
-rw-r--r--mingling_pathf/test/src/test_files/test_group.rs13
-rw-r--r--mingling_pathf/test/src/test_files/test_groupped_derive.rs26
-rw-r--r--mingling_pathf/test/src/test_files/test_help.rs33
-rw-r--r--mingling_pathf/test/src/test_files/test_pack.rs17
-rw-r--r--mingling_pathf/test/src/test_files/test_renderer.rs33
9 files changed, 274 insertions, 0 deletions
diff --git a/mingling_pathf/test/src/test_files/test_chain.rs b/mingling_pathf/test/src/test_files/test_chain.rs
new file mode 100644
index 0000000..e209a5e
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_chain.rs
@@ -0,0 +1,61 @@
+#[mingling::macros::chain]
+fn my_chain1(prev: Some1) -> Next {
+
+}
+
+#[mingling::macros::chain]
+pub fn my_chain2(prev: Some2) -> Next {
+
+}
+
+#[mingling::macros::chain]
+pub async fn my_chain3(prev: Some3) -> Next {
+
+}
+
+#[chain]
+fn my_chain4(prev: Some4) {
+
+}
+
+#[chain]
+pub fn my_chain5(prev: Some5) {
+
+}
+
+#[chain]
+pub async fn my_chain6(prev: Some6) {
+
+}
+
+pub mod sub {
+ #[mingling::macros::chain]
+ fn my_chain1(prev: Some1) -> Next {
+
+ }
+
+ #[mingling::macros::chain]
+ pub fn my_chain2(prev: Some2) -> Next {
+
+ }
+
+ #[mingling::macros::chain]
+ pub async fn my_chain3(prev: Some3) -> Next {
+
+ }
+
+ #[chain]
+ fn my_chain4(prev: Some4) {
+
+ }
+
+ #[chain]
+ pub fn my_chain5(prev: Some5) {
+
+ }
+
+ #[chain]
+ pub async fn my_chain6(prev: Some6) {
+
+ }
+}
diff --git a/mingling_pathf/test/src/test_files/test_completion.rs b/mingling_pathf/test/src/test_files/test_completion.rs
new file mode 100644
index 0000000..87a655f
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_completion.rs
@@ -0,0 +1,41 @@
+#[mingling::macros::completion(Some1)]
+fn my_completion1(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+}
+
+#[mingling::macros::completion(Some2)]
+pub fn my_completion2(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+}
+
+#[completion(Some3)]
+fn my_completion3(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+}
+
+#[completion(Some4)]
+pub fn my_completion4(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+}
+
+pub mod sub {
+ #[mingling::macros::completion(Some1)]
+ fn my_completion1(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+ }
+
+ #[mingling::macros::completion(Some2)]
+ pub fn my_completion2(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+ }
+
+ #[completion(Some3)]
+ fn my_completion3(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+ }
+
+ #[completion(Some4)]
+ pub fn my_completion4(ctx: &mingling::ShellContext) -> mingling::Suggest {
+ mingling::Suggest::new()
+ }
+}
diff --git a/mingling_pathf/test/src/test_files/test_dispatcher.rs b/mingling_pathf/test/src/test_files/test_dispatcher.rs
new file mode 100644
index 0000000..48f5e4d
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_dispatcher.rs
@@ -0,0 +1,17 @@
+mingling::macros::dispatcher!("greet", CMDGreet => EntryGreet);
+mingling::macros::dispatcher!("greet");
+mingling::macros::dispatcher!("remote.add", CMDRemoteAdd => EntryRemoteAdd);
+mingling::macros::dispatcher!("remote.add");
+
+dispatcher!("delete", CMDDelete => EntryDelete);
+dispatcher!("delete");
+dispatcher!("remote.rm", CMDRemoteRm => EntryRemoteRm);
+dispatcher!("remote.rm");
+
+pub mod sub {
+ mingling::macros::dispatcher!("greet", CMDGreet => EntryGreet);
+ mingling::macros::dispatcher!("greet");
+
+ dispatcher!("delete", CMDDelete => EntryDelete);
+ dispatcher!("delete");
+}
diff --git a/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs b/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs
new file mode 100644
index 0000000..0ba884d
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_dispatcher_clap.rs
@@ -0,0 +1,33 @@
+#[mingling::macros::dispatcher_clap]
+struct EntryClap1 {
+ name: String,
+ age: i32,
+}
+
+#[mingling::macros::dispatcher_clap]
+#[command(name = "greet")]
+pub struct EntryClap2 {
+ name: String,
+}
+
+#[dispatcher_clap]
+struct EntryClap3 {
+ value: String,
+}
+
+#[dispatcher_clap]
+pub struct EntryClap4 {
+ value: i32,
+}
+
+pub mod sub {
+ #[mingling::macros::dispatcher_clap]
+ struct EntryClap1 {
+ name: String,
+ }
+
+ #[dispatcher_clap]
+ struct EntryClap3 {
+ value: String,
+ }
+}
diff --git a/mingling_pathf/test/src/test_files/test_group.rs b/mingling_pathf/test/src/test_files/test_group.rs
new file mode 100644
index 0000000..92c8cda
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_group.rs
@@ -0,0 +1,13 @@
+mingling::macros::group!(Group1);
+mingling::macros::group!(GroupAlias1 = std::io::Error);
+
+group!(Group2);
+group!(GroupAlias2 = std::num::ParseIntError);
+
+pub mod sub {
+ mingling::macros::group!(Group1);
+ mingling::macros::group!(GroupAlias1 = std::io::Error);
+
+ group!(Group2);
+ group!(GroupAlias2 = std::num::ParseIntError);
+}
diff --git a/mingling_pathf/test/src/test_files/test_groupped_derive.rs b/mingling_pathf/test/src/test_files/test_groupped_derive.rs
new file mode 100644
index 0000000..f6c6fa9
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_groupped_derive.rs
@@ -0,0 +1,26 @@
+#[derive(Groupped)]
+struct Derived1 {
+ value: String,
+}
+
+#[derive(Groupped, Debug, Clone)]
+struct Derived2 {
+ value: i32,
+}
+
+#[derive(GrouppedSerialize)]
+struct Derived3 {
+ value: bool,
+}
+
+pub mod sub {
+ #[derive(Groupped)]
+ struct Derived1 {
+ value: String,
+ }
+
+ #[derive(GrouppedSerialize)]
+ struct Derived3 {
+ value: bool,
+ }
+}
diff --git a/mingling_pathf/test/src/test_files/test_help.rs b/mingling_pathf/test/src/test_files/test_help.rs
new file mode 100644
index 0000000..52d1408
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_help.rs
@@ -0,0 +1,33 @@
+#[mingling::macros::help]
+fn my_help1(prev: Some1) {
+}
+
+#[mingling::macros::help]
+pub fn my_help2(prev: Some2) {
+}
+
+#[help]
+fn my_help3(prev: Some3) {
+}
+
+#[help]
+pub fn my_help4(prev: Some4) {
+}
+
+pub mod sub {
+ #[mingling::macros::help]
+ fn my_help1(prev: Some1) {
+ }
+
+ #[mingling::macros::help]
+ pub fn my_help2(prev: Some2) {
+ }
+
+ #[help]
+ fn my_help3(prev: Some3) {
+ }
+
+ #[help]
+ pub fn my_help4(prev: Some4) {
+ }
+}
diff --git a/mingling_pathf/test/src/test_files/test_pack.rs b/mingling_pathf/test/src/test_files/test_pack.rs
new file mode 100644
index 0000000..759e35f
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_pack.rs
@@ -0,0 +1,17 @@
+mingling::macros::pack!(ResultPack1 = String);
+mingling::macros::pack_err!(ErrorPack1);
+mingling::macros::pack_err!(ErrorPack2 = PathBuf);
+
+pack!(ResultPack2 = (u8, String));
+pack_err!(ErrorPack3);
+pack_err!(ErrorPack4 = PathBuf);
+
+pub mod sub {
+ mingling::macros::pack!(ResultPack1 = String);
+ mingling::macros::pack_err!(ErrorPack1);
+ mingling::macros::pack_err!(ErrorPack2 = PathBuf);
+
+ pack!(ResultPack2 = (u8, String));
+ pack_err!(ErrorPack3);
+ pack_err!(ErrorPack4 = PathBuf);
+}
diff --git a/mingling_pathf/test/src/test_files/test_renderer.rs b/mingling_pathf/test/src/test_files/test_renderer.rs
new file mode 100644
index 0000000..ea52f5c
--- /dev/null
+++ b/mingling_pathf/test/src/test_files/test_renderer.rs
@@ -0,0 +1,33 @@
+#[mingling::macros::renderer]
+fn my_renderer1(prev: Some1) {
+}
+
+#[mingling::macros::renderer]
+pub fn my_renderer2(prev: Some2) {
+}
+
+#[renderer]
+fn my_renderer3(prev: Some3) {
+}
+
+#[renderer]
+pub fn my_renderer4(prev: Some4) {
+}
+
+pub mod sub {
+ #[mingling::macros::renderer]
+ fn my_renderer1(prev: Some1) {
+ }
+
+ #[mingling::macros::renderer]
+ pub fn my_renderer2(prev: Some2) {
+ }
+
+ #[renderer]
+ fn my_renderer3(prev: Some3) {
+ }
+
+ #[renderer]
+ pub fn my_renderer4(prev: Some4) {
+ }
+}