Add Windows path test
This commit is contained in:
parent
a3dd7fecb4
commit
4e77ecadc0
1 changed files with 14 additions and 0 deletions
|
|
@ -88,6 +88,20 @@ mod tests {
|
|||
assert_eq!(config.directory, PathBuf::from_str("/").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parses_windows_config() {
|
||||
let config = Config::new(
|
||||
vec!["/", "-i", "127.0.0.1", "-d", r"C:\Users\", "-p", "1567"]
|
||||
.iter()
|
||||
.map(|s| s.to_string()),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(config.ip_address, Ipv4Addr::new(127, 0, 0, 1));
|
||||
assert_eq!(config.port, 1567);
|
||||
assert_eq!(config.directory, PathBuf::from_str(r"C:\Users\").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parses_some_config() {
|
||||
let config = Config::new(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue