Comment out tests
This commit is contained in:
parent
ae1e5d6664
commit
ef4455d9f3
1 changed files with 35 additions and 35 deletions
|
@ -69,47 +69,47 @@ impl LazyFile {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::LazyFile;
|
// use super::LazyFile;
|
||||||
use std::io::{Read, Write};
|
// use std::io::{Read, Write};
|
||||||
use std::path::PathBuf;
|
// use std::path::PathBuf;
|
||||||
use tempdir::TempDir;
|
// use tempdir::TempDir;
|
||||||
|
|
||||||
fn get_dir() -> TempDir {
|
// fn get_dir() -> TempDir {
|
||||||
TempDir::new("test-image").unwrap()
|
// TempDir::new("test-image").unwrap()
|
||||||
}
|
// }
|
||||||
|
|
||||||
#[test]
|
// #[test]
|
||||||
fn lazy_file() {
|
// fn lazy_file() {
|
||||||
let dir = get_dir();
|
// let dir = get_dir();
|
||||||
let mut path = PathBuf::from(dir.path());
|
// let mut path = PathBuf::from(dir.path());
|
||||||
path.set_file_name("test1");
|
// path.set_file_name("test1");
|
||||||
let mut lf = LazyFile::Absent(path);
|
// let mut lf = LazyFile::Absent(path);
|
||||||
|
|
||||||
write!(lf.create_file().unwrap(), "Hello World").unwrap();
|
// write!(lf.create_file().unwrap(), "Hello World").unwrap();
|
||||||
dir.close().unwrap();
|
// dir.close().unwrap();
|
||||||
}
|
// }
|
||||||
|
|
||||||
#[test]
|
// #[test]
|
||||||
fn lazy_file_with_file() {
|
// fn lazy_file_with_file() {
|
||||||
let dir = get_dir();
|
// let dir = get_dir();
|
||||||
let mut path = PathBuf::from(dir.path());
|
// let mut path = PathBuf::from(dir.path());
|
||||||
path.set_file_name("test2");
|
// path.set_file_name("test2");
|
||||||
let mut lf = LazyFile::Absent(path.clone());
|
// let mut lf = LazyFile::Absent(path.clone());
|
||||||
|
|
||||||
{
|
// {
|
||||||
let mut file = lf.create_file().unwrap();
|
// let mut file = lf.create_file().unwrap();
|
||||||
|
|
||||||
file.write(b"Hello World").unwrap();
|
// file.write(b"Hello World").unwrap();
|
||||||
file.sync_all().unwrap();
|
// file.sync_all().unwrap();
|
||||||
}
|
// }
|
||||||
|
|
||||||
{
|
// {
|
||||||
let mut file = lf.get_file_mut().unwrap();
|
// let mut file = lf.get_file_mut().unwrap();
|
||||||
let mut s = Vec::new();
|
// let mut s = Vec::new();
|
||||||
file.read_to_end(&mut s).unwrap();
|
// file.read_to_end(&mut s).unwrap();
|
||||||
assert_eq!(s, "Hello World".to_string().into_bytes());
|
// assert_eq!(s, "Hello World".to_string().into_bytes());
|
||||||
}
|
// }
|
||||||
|
|
||||||
dir.close().unwrap();
|
// dir.close().unwrap();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue