Commit 41bdf779 authored by stratact's avatar stratact

Fix tests, take 2

parent 7892f914
Pipeline #1566 failed with stage
in 1 minute and 37 seconds
......@@ -90,7 +90,7 @@ fn test_in_file_history_truncating() {
{
let mut h = History::new();
h.set_file_name_and_load_history(tmp_file);
h.set_file_name_and_load_history(&tmp_file);
h.set_max_file_size(5);
for _ in 0..20 {
h.push(Buffer::from("a")).unwrap();
......@@ -98,7 +98,7 @@ fn test_in_file_history_truncating() {
h.commit_to_file();
}
let f = fs::File::open(tmp_file.clone()).unwrap();
let f = fs::File::open(&tmp_file).unwrap();
let r = BufReader::new(f);
let count = r.lines().count();
assert_eq!(count, 5);
......@@ -125,8 +125,8 @@ fn test_reading_from_file() {
.unwrap();
f.write_all(TEXT.as_bytes()).unwrap();
}
let h = History::new()
.set_file_name_and_load_history(tmp_file);
let mut h = History::new();
h.set_file_name_and_load_history(tmp_file);
assert_eq!(String::from(h.buffers[0].clone()), "a".to_string());
assert_eq!(String::from(h.buffers[1].clone()), "b".to_string());
assert_eq!(String::from(h.buffers[2].clone()), "c".to_string());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment