119625d8cSopenharmony_ci#[test] 219625d8cSopenharmony_cifn insert() { 319625d8cSopenharmony_ci let mut raw = clap_lex::RawArgs::new(["bin", "a", "b", "c"]); 419625d8cSopenharmony_ci let mut cursor = raw.cursor(); 519625d8cSopenharmony_ci 619625d8cSopenharmony_ci assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("bin"))); 719625d8cSopenharmony_ci assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("a"))); 819625d8cSopenharmony_ci raw.insert(&cursor, ["1", "2", "3"]); 919625d8cSopenharmony_ci assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("1"))); 1019625d8cSopenharmony_ci assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("2"))); 1119625d8cSopenharmony_ci assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("3"))); 1219625d8cSopenharmony_ci assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("b"))); 1319625d8cSopenharmony_ci assert_eq!(raw.next_os(&mut cursor), Some(std::ffi::OsStr::new("c"))); 1419625d8cSopenharmony_ci 1519625d8cSopenharmony_ci let mut cursor = raw.cursor(); 1619625d8cSopenharmony_ci let rest = raw 1719625d8cSopenharmony_ci .remaining(&mut cursor) 1819625d8cSopenharmony_ci .map(|s| s.to_string_lossy()) 1919625d8cSopenharmony_ci .collect::<Vec<_>>(); 2019625d8cSopenharmony_ci assert_eq!(rest, vec!["bin", "a", "1", "2", "3", "b", "c"]); 2119625d8cSopenharmony_ci} 22