Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Sep 10, 2021
1 parent 59b1859 commit 9b2898d
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ pub fn open(
mod tests {
use super::*;
use std::fs;
use std::fs::Permissions;
use std::os::unix::fs::PermissionsExt;

#[test]
fn test_input_with_none() {
Expand All @@ -86,26 +84,6 @@ mod tests {
assert!(input.is_err());
}

#[test]
fn test_input_with_no_read_write() {
let no_read_permission = Permissions::from_mode(0);
let _ = fs::set_permissions("testdata/no_read_write.txt", no_read_permission);
let input = open_input(Some("testdata/no_read_write.txt".to_string()));
assert!(input.is_err());
let default_permission = Permissions::from_mode(0o644);
let _ = fs::set_permissions("testdata/no_read_write.txt", default_permission);
}

#[test]
fn test_output_with_no_read_write() {
let no_read_permission = Permissions::from_mode(0);
let _ = fs::set_permissions("testdata/no_read_write.txt", no_read_permission);
let output = open_output(Some("testdata/no_read_write.txt".to_string()));
assert!(output.is_err());
let default_permission = Permissions::from_mode(0o644);
let _ = fs::set_permissions("testdata/no_read_write.txt", default_permission);
}

#[test]
fn test_output_with_not_exist_file() {
let output = open_output(Some("testdata/not_exist_file.txt".to_string()));
Expand Down

0 comments on commit 9b2898d

Please sign in to comment.