diff --git a/src/cache.rs b/src/cache.rs index 8a6d662..87db30c 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -74,7 +74,7 @@ impl PageLookupResult { // because it avoids the boxing below. However, the performance impact // would first need to be shown to be significant using a benchmark. Ok(BufReader::new(if let Some(patch_file) = patch_file_opt { - Box::new(page_file.chain(patch_file)) as Box + Box::new(page_file.chain(&b"\n"[..]).chain(patch_file)) as Box } else { Box::new(page_file) as Box })) @@ -415,7 +415,7 @@ mod tests { let mut buf = Vec::new(); reader.read_to_end(&mut buf).unwrap(); - assert_eq!(&buf, b"Hello\nWorld"); + assert_eq!(&buf, b"Hello\n\nWorld"); } #[test] @@ -425,7 +425,7 @@ mod tests { let page_path = dir.path().join("test.page"); { let mut f = File::create(&page_path).unwrap(); - f.write_all(b"Hello").unwrap(); + f.write_all(b"Hello\n").unwrap(); } // Create chained reader from lookup result @@ -436,6 +436,6 @@ mod tests { let mut buf = Vec::new(); reader.read_to_end(&mut buf).unwrap(); - assert_eq!(&buf, b"Hello"); + assert_eq!(&buf, b"Hello\n"); } } diff --git a/tests/inkscape-v2.patch b/tests/inkscape-v2.patch index 762cf15..5cc5d22 100644 --- a/tests/inkscape-v2.patch +++ b/tests/inkscape-v2.patch @@ -1,4 +1,3 @@ - Custom inkscape entry My Inkscape example