Added `test_open_file()`

This commit is contained in:
Volodymyr Patuta 2020-10-13 12:15:04 +02:00
parent 1ee584801a
commit 8c04fe7b9d
1 changed files with 8 additions and 0 deletions

View File

@ -62,4 +62,12 @@ mod tests {
assert!(parse_instruction('F').is_ok()); assert!(parse_instruction('F').is_ok());
assert!(parse_instruction('Z').is_err()); assert!(parse_instruction('Z').is_err());
} }
#[test]
fn test_open_file() {
assert!(open_file("two_robots.txt").is_ok());
assert!(open_file("test_unexisting_file.extension").is_err());
assert!(open_file("no_permission.txt").is_err());
}
} }