remove extra logging
This commit is contained in:
parent
69793b2a95
commit
d9589e260d
3 changed files with 0 additions and 12 deletions
|
@ -18,14 +18,11 @@ impl FileEnv {
|
|||
Self {
|
||||
open: Box::new(move |file_name| {
|
||||
let path = format!("{}/{}", &open_dir, file_name);
|
||||
println!("opening {}", path);
|
||||
let file = File::open(&path)?;
|
||||
println!("opened {}", path);
|
||||
Ok(file)
|
||||
}),
|
||||
append_line: Box::new(move |file_name, line| {
|
||||
let path = format!("{}/{}", &append_dir, file_name);
|
||||
println!("appending to {}", path);
|
||||
let mut file = OpenOptions::new()
|
||||
.write(true)
|
||||
.append(true)
|
||||
|
@ -33,7 +30,6 @@ impl FileEnv {
|
|||
.open(&path)
|
||||
.unwrap();
|
||||
writeln!(file, "{}", line)?;
|
||||
println!("appended to {}", path);
|
||||
Ok(())
|
||||
}),
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ use crate::prelude::*;
|
|||
use super::Link;
|
||||
|
||||
pub fn add(link: &Link, file_name: &str, e: &FileEnv) -> Result<()> {
|
||||
println!("history::append::to {}", file_name);
|
||||
(e.append_line)(file_name, &link.href)?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -25,7 +24,6 @@ mod tests {
|
|||
let file_name = "download.txt";
|
||||
let dir = create_text_file(file_name, include_bytes!("../../test/data/empty.txt"))?;
|
||||
let path = format!("{}/{}", dir.path().to_string_lossy(), file_name);
|
||||
println!("removing file {}", path);
|
||||
std::fs::remove_file(path)?;
|
||||
|
||||
let link = Link {
|
||||
|
@ -37,18 +35,14 @@ mod tests {
|
|||
length: None,
|
||||
};
|
||||
//when
|
||||
println!("about to add");
|
||||
add(
|
||||
&link,
|
||||
file_name,
|
||||
&FileEnv::create(dir.path().to_string_lossy().to_string()),
|
||||
)?;
|
||||
println!("called add");
|
||||
|
||||
//then
|
||||
println!("about to read file contents");
|
||||
let content: Vec<String> = read_text_file(dir.path(), file_name)?;
|
||||
println!("read file contents");
|
||||
drop(dir);
|
||||
|
||||
let expected = vec!["foo".to_string()];
|
||||
|
|
|
@ -27,7 +27,6 @@ pub fn create_text_file(name: &str, data: &[u8]) -> Result<TempDir> {
|
|||
|
||||
pub fn read_text_file(path: &Path, file_name: &str) -> Result<Vec<String>> {
|
||||
let file_name = format!("{}/{}", path.to_str().unwrap(), file_name);
|
||||
println!("test_utils::read_text_file: {}", file_name);
|
||||
Ok(read_to_string(file_name)?
|
||||
.lines()
|
||||
.map(String::from)
|
||||
|
@ -64,7 +63,6 @@ pub fn mock_network_fetch_as_bytes_with_rss_entries(
|
|||
pub fn mock_file_open(real_paths: HashMap<String, String>) -> FileOpenFn {
|
||||
Box::new(move |path: &str| {
|
||||
if let Some(real_path) = real_paths.get(&path.to_string()) {
|
||||
println!("opening {}", real_path);
|
||||
Ok(File::open(real_path)?)
|
||||
} else {
|
||||
Err(Error::message(
|
||||
|
|
Loading…
Add table
Reference in a new issue