| 1 |
[1m--- [0msrc/[1mfile.rs[0m |
| 2 |
[1m+++ [0msrc/[1mfile.rs[0m |
| 3 |
[36m@@ -442,9 +438,9 @@ [1mmod tests {[0m |
| 4 |
println!("Evaluating example file <{}>...", diff.to_str().unwrap()); |
| 5 |
|
| 6 |
// Run highlighting on the file into a memory buffer |
| 7 |
[31m- let [7mmut actual_result: Vec<u8>[27m = [7mVec[27m::new();[0m |
| 8 |
[31m- highlight_diff(&mut fs::File::open(diff).unwrap(), [7m&mut actual_result[27m);[0m |
| 9 |
[31m- let actual_result = [7mstr[27m::[7mfrom_utf8(&actual_result[27m).unwrap();[0m |
| 10 |
[32m+ let [7mfile[27m = [7mtempfile::NamedTempFile[27m::new()[7m.unwrap()[27m;[0m |
| 11 |
[32m+ highlight_diff(&mut fs::File::open(diff).unwrap(), [7mfile.reopen().unwrap()[27m);[0m |
| 12 |
[32m+ let actual_result = [7mfs[27m::[7mread_to_string(file.path[27m()[7m)[27m.unwrap();[0m |
| 13 |
|
| 14 |
// Load the corresponding .riff-output file into a string |
| 15 |
let basename = diff.file_stem().unwrap().to_str().unwrap(); |