diff --git a/Cargo.toml b/Cargo.toml index 84b2673..c2f87f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "mapped-file" description = "Construct a memory mapping over any file object" keywords = ["unix", "mmap", "generic", "file", "fd"] -version = "0.0.5" +version = "0.0.6" edition = "2021" repository="https://github.com/notflan/mapped-file" license="MIT" diff --git a/src/file.rs b/src/file.rs index 0ff5363..27aacb1 100644 --- a/src/file.rs +++ b/src/file.rs @@ -39,4 +39,13 @@ mod tests test_fileno::("STDOUT_FILENO", std::io::stdout().as_raw_fd()); test_fileno::("STDERR_FILENO", std::io::stderr().as_raw_fd()); } + + #[test] + fn test_readwrite() + { + let mut input = ManagedFD::from(memory::MemoryFile::new().unwrap()); + let mut output = memory::MemoryFile::new().unwrap(); + assert_eq!(std::io::copy(&mut input, &mut output).unwrap(), 0, "Bad read"); + + } }