use super::getopt;

use std::collections::HashMap;

#[test]
fn it_consume() {
    let getopt_for_consumption = getopt {
        arguments: vec!["a".to_string(), "b".to_string()],
        options   : HashMap::new(),
        option_has_arg: HashMap::new()
    };

    for arg in getopt_for_consumption {
        println!("Zkonzumovany argument: {}", arg);
    }
}

#[test]
fn it_immutable_ref() {
   let my_getopt = getopt {
        arguments: vec![
            "param1".to_string(),
            "file.txt".to_string(),
            "verbose".to_string(),
        ],
        options   : HashMap::new(),
        option_has_arg: HashMap::new()
    };

    for arg in &my_getopt {
        println!("immutable: {}", arg);
    }
    // original arguments still exists
    assert_eq!(my_getopt.arguments.len(), 3);
    assert_eq!(my_getopt.len(), 3);
}
