From 3a10ac360b099c3e9a647b0c4ff9fbc84033c160 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Thu, 29 Jan 2026 19:59:29 +0000 Subject: [PATCH] Initial commit: git-issue-commit CLI tool --- tests/cli_tests.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/cli_tests.rs diff --git a/tests/cli_tests.rs b/tests/cli_tests.rs new file mode 100644 index 0000000..df070de --- /dev/null +++ b/tests/cli_tests.rs @@ -0,0 +1,24 @@ +#[cfg(test)] +mod cli_tests { + use clap::Parser; + + #[derive(Parser, Debug)] + struct TestArgs { + #[arg(short, long)] + url: Option, + #[arg(short, long)] + text: Option, + } + + #[test] + fn test_args_parse_url() { + let args = TestArgs::parse_from(["test", "--url", "https://github.com/user/repo/issues/123"]); + assert_eq!(args.url, Some("https://github.com/user/repo/issues/123".to_string())); + } + + #[test] + fn test_args_parse_text() { + let args = TestArgs::parse_from(["test", "--text", "fix a bug in auth"]); + assert_eq!(args.text, Some("fix a bug in auth".to_string())); + } +}