Skip to content

Commit 45b777e

Browse files
committed
Fix SyncTeX tests: gzipped files seem platform dependent
1 parent 74a82e5 commit 45b777e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/tex-outputs.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// Copyright 2016-2017 the Tectonic Project
22
// Licensed under the MIT License.
33

4+
extern crate flate2;
45
#[macro_use] extern crate lazy_static;
56
extern crate tectonic;
67

8+
use flate2::read::GzDecoder;
79
use std::collections::HashSet;
810
use std::ffi::OsStr;
911
use std::fs::File;
@@ -44,7 +46,7 @@ fn set_up_format_file(tests_dir: &Path) -> Result<SingleInputFileIo> {
4446
&mut fs,
4547
]);
4648

47-
let mut e = TexEngine::new()
49+
TexEngine::new()
4850
.halt_on_error_mode(true)
4951
.initex_mode(true)
5052
.process(&mut io, &mut NoopIoEventBackend::new(),
@@ -148,10 +150,15 @@ fn do_one(stem: &str, check_synctex: bool) {
148150

149151
if check_synctex {
150152
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();
152157
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);
155162
}
156163
}
157164

0 commit comments

Comments
 (0)