File: tests-ignore-missing-files

package info (click to toggle)
rust-liblzma 0.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 276 kB
  • sloc: makefile: 2
file content (58 lines) | stat: -rw-r--r-- 1,725 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Author: Michael R. Crusoe <crusoe@debian.org>
Description: skip test relying on files missing from the upstream archive
Forwarded: not-needed
--- liblzma.orig/tests/xz.rs
+++ liblzma/tests/xz.rs
@@ -6,52 +6,6 @@
 use liblzma::stream;
 use liblzma::write;
 
-#[test]
-fn standard_files() {
-    for file in Path::new("liblzma-sys/xz/tests/files").read_dir().unwrap() {
-        let file = file.unwrap();
-        if file.path().extension().and_then(|s| s.to_str()) != Some("xz") {
-            continue;
-        }
-
-        let filename = file.file_name().into_string().unwrap();
-
-        // This appears to be implementation-defined how it's handled
-        if filename.contains("unsupported-check") {
-            continue;
-        }
-
-        println!("testing {:?}", file.path());
-        let mut contents = Vec::new();
-        File::open(&file.path())
-            .unwrap()
-            .read_to_end(&mut contents)
-            .unwrap();
-        if filename.starts_with("bad") || filename.starts_with("unsupported") {
-            test_bad(&contents);
-        } else {
-            test_good(&contents);
-        }
-    }
-}
-
-fn test_good(data: &[u8]) {
-    let mut ret = Vec::new();
-    read::XzDecoder::new_multi_decoder(data)
-        .read_to_end(&mut ret)
-        .unwrap();
-    let mut w = write::XzDecoder::new_multi_decoder(ret);
-    w.write_all(data).unwrap();
-    w.finish().unwrap();
-}
-
-fn test_bad(data: &[u8]) {
-    let mut ret = Vec::new();
-    assert!(read::XzDecoder::new(data).read_to_end(&mut ret).is_err());
-    let mut w = write::XzDecoder::new(ret);
-    assert!(w.write_all(data).is_err() || w.finish().is_err());
-}
-
 fn assert_send_sync<T: Send + Sync>() {}
 
 #[test]