Test ErrorKind::AlreadyExists for files
This commit is contained in:
parent
5db9424de3
commit
1db97575cc
@ -1770,6 +1770,15 @@ fn file_test_directoryinfo_readdir() {
|
||||
check!(fs::remove_dir(dir));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn file_create_new_already_exists_error() {
|
||||
let tmpdir = tmpdir();
|
||||
let file = &tmpdir.join("file_create_new_error_exists");
|
||||
check!(fs::File::create(file));
|
||||
let e = fs::OpenOptions::new().write(true).create_new(true).open(file).unwrap_err();
|
||||
assert_eq!(e.kind(), ErrorKind::AlreadyExists);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mkdir_path_already_exists_error() {
|
||||
let tmpdir = tmpdir();
|
||||
|
Loading…
Reference in New Issue
Block a user