diff options
| author | A Farzat <a@farzat.xyz> | 2026-06-20 13:07:25 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-06-20 13:07:25 +0300 |
| commit | 8412c6d66eb243d5772f6ac7586e3f265c380f1e (patch) | |
| tree | b27cae6950059c070243b361f7e6dd83ecf326f2 | |
| parent | aa2aa9febd01918d2b702b15a5cb14d115b8a265 (diff) | |
| download | repo2markdown-8412c6d66eb243d5772f6ac7586e3f265c380f1e.tar.gz repo2markdown-8412c6d66eb243d5772f6ac7586e3f265c380f1e.zip | |
Add double dash tests to r2md append & prepend
| -rw-r--r-- | src/bin/r2md-append.rs | 19 | ||||
| -rw-r--r-- | src/bin/r2md-prepend.rs | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/bin/r2md-append.rs b/src/bin/r2md-append.rs index 4cd2ae9..4dd0698 100644 --- a/src/bin/r2md-append.rs +++ b/src/bin/r2md-append.rs @@ -47,4 +47,23 @@ mod tests { vec![OsString::from("README.md"), OsString::from("src/main.rs")] ); } + + #[test] + fn treats_arguments_after_double_dash_as_paths() { + let cli = Cli::try_parse_from([ + "r2md-append", + "--", + "--filename-that-looks-like-an-option", + "main.rs", + ]) + .unwrap(); + + assert_eq!( + cli.paths, + vec![ + OsString::from("--filename-that-looks-like-an-option"), + OsString::from("main.rs") + ] + ); + } } diff --git a/src/bin/r2md-prepend.rs b/src/bin/r2md-prepend.rs index 2649587..7297fb6 100644 --- a/src/bin/r2md-prepend.rs +++ b/src/bin/r2md-prepend.rs @@ -47,4 +47,23 @@ mod tests { vec![OsString::from("README.md"), OsString::from("src/main.rs")] ); } + + #[test] + fn treats_arguments_after_double_dash_as_paths() { + let cli = Cli::try_parse_from([ + "r2md-prepend", + "--", + "--filename-that-looks-like-an-option", + "main.rs", + ]) + .unwrap(); + + assert_eq!( + cli.paths, + vec![ + OsString::from("--filename-that-looks-like-an-option"), + OsString::from("main.rs") + ] + ); + } } |
