I'm writing a Rust program where I do manual command-line argument parsing. I skip the first argument since that's the executable and I don't care about that, then check the second argument for what subcommand to run. Then I pass on the rest of env::Args to that subcommand's function for parsing of the subcommand arguments.
Now, I want to add some tests that test the entire subcommands to see if they do what's expected of them—a bit like integration tests except within the codebase. However, I can't find any way to construct my own env::Args. Is this something that's possible? I had a look at a similar question about replacing an entry in env::Args but it seems that's impossible.
Is there any way I can achieve what I want, i.e. testing of my subcommand functions that take an env::Args by providing a forged one?
Vec.