File: highlight-middle-line.riff-output

package info (click to toggle)
rust-riffdiff 3.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 5,784 kB
  • sloc: sh: 206; python: 132; makefile: 11
file content (15 lines) | stat: -rw-r--r-- 1,011 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- src/file.rs
+++ src/file.rs
@@ -442,9 +438,9 @@ mod tests {
             println!("Evaluating example file <{}>...", diff.to_str().unwrap());

             // Run highlighting on the file into a memory buffer
-            let mut actual_result: Vec<u8> = Vec::new();
-            highlight_diff(&mut fs::File::open(diff).unwrap(), &mut actual_result);
-            let actual_result = str::from_utf8(&actual_result).unwrap();
+            let file = tempfile::NamedTempFile::new().unwrap();
+            highlight_diff(&mut fs::File::open(diff).unwrap(), file.reopen().unwrap());
+            let actual_result = fs::read_to_string(file.path()).unwrap();

             // Load the corresponding .riff-output file into a string
             let basename = diff.file_stem().unwrap().to_str().unwrap();