|
1 | 1 | // Copyright 2016-2017 the Tectonic Project
|
2 | 2 | // Licensed under the MIT License.
|
3 | 3 |
|
| 4 | +extern crate flate2; |
4 | 5 | #[macro_use] extern crate lazy_static;
|
5 | 6 | extern crate tectonic;
|
6 | 7 |
|
| 8 | +use flate2::read::GzDecoder; |
7 | 9 | use std::collections::HashSet;
|
8 | 10 | use std::ffi::OsStr;
|
9 | 11 | use std::fs::File;
|
@@ -44,7 +46,7 @@ fn set_up_format_file(tests_dir: &Path) -> Result<SingleInputFileIo> {
|
44 | 46 | &mut fs,
|
45 | 47 | ]);
|
46 | 48 |
|
47 |
| - let mut e = TexEngine::new() |
| 49 | + TexEngine::new() |
48 | 50 | .halt_on_error_mode(true)
|
49 | 51 | .initex_mode(true)
|
50 | 52 | .process(&mut io, &mut NoopIoEventBackend::new(),
|
@@ -148,10 +150,15 @@ fn do_one(stem: &str, check_synctex: bool) {
|
148 | 150 |
|
149 | 151 | if check_synctex {
|
150 | 152 | p.set_extension("synctex.gz");
|
151 |
| - let expected_synctex = read_file(&p); |
| 153 | + // Gzipped files seem to be platform dependent and so we decompress them first. |
| 154 | + let mut expected_synctex = Vec::new(); |
| 155 | + GzDecoder::new(File::open(&p).unwrap()).unwrap() |
| 156 | + .read_to_end(&mut expected_synctex).unwrap(); |
152 | 157 | let synctexname = p.file_name().unwrap().to_owned();
|
153 |
| - let observed_synctex = files.get(&synctexname).unwrap(); |
154 |
| - test_file(&synctexname, &expected_synctex, observed_synctex); |
| 158 | + let mut observed_synctex = Vec::new(); |
| 159 | + GzDecoder::new(&files.get(&synctexname).unwrap()[..]).unwrap() |
| 160 | + .read_to_end(&mut observed_synctex).unwrap(); |
| 161 | + test_file(&synctexname, &expected_synctex, &observed_synctex); |
155 | 162 | }
|
156 | 163 | }
|
157 | 164 |
|
|
0 commit comments