From 8c04fe7b9d7f13d5b7bd6481a4f7c2475279a55d Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <90917-fiplox@users.noreply.framagit.org> Date: Tue, 13 Oct 2020 12:15:04 +0200 Subject: [PATCH] Added `test_open_file()` --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 11282a9..d4782fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,4 +62,12 @@ mod tests { assert!(parse_instruction('F').is_ok()); 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()); + } + }