I would like to test a function that takes a std::env::Args iterator as argument but without using the command line and providing the arguments with a Vec:
use std::env;
fn main() {
let v = vec!["hello".to_string(), "world".to_string()];
print_iterator(env::args()); // with the command line
print_iterator( ??? ); // how should I do with v?
}
fn print_iterator(mut args: env::Args) {
println!("{:?}", args.next());
println!("{:?}", args.next());
}