use std::path::PathBuf; use dupnamegen::{namegen, Naming}; #[cfg(unix)] #[test] fn noext() { let mut gen = namegen("hello", Naming::DashNum, 1).unwrap(); assert_eq!(gen(), PathBuf::from("hello-1")); assert_eq!(gen(), PathBuf::from("hello-2")); } #[cfg(unix)] #[test] fn ext() { let mut gen = namegen("hello.txt", Naming::DashNum, 1).unwrap(); assert_eq!(gen(), PathBuf::from("hello.txt-1")); assert_eq!(gen(), PathBuf::from("hello.txt-2")); } // vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :