File: adjust-tests

package info (click to toggle)
rust-needletail 0.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,768 kB
  • sloc: makefile: 2
file content (192 lines) | stat: -rw-r--r-- 6,627 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
Author: Michael R. Crusoe <crusoe@gmail.com>
Description: Remove tests referencing missing tests data
Forwarded: not-needed

Drop this patch once upstream ships the "tests" data in their crate.
--- needletail.orig/src/parser/fastq.rs
+++ needletail/src/parser/fastq.rs
@@ -601,29 +601,4 @@
         let e = rec.unwrap_err();
         assert_eq!(e.kind, ParseErrorKind::UnequalLengths);
     }
-
-    // https://github.com/onecodex/needletail/pull/36
-    #[test]
-    fn test_bad_headers() {
-        let mut reader = Reader::from_path("tests/data/bad_header.fastq").unwrap();
-        let rec = reader.next().unwrap();
-        assert!(rec.is_ok());
-        let rec2 = reader.next().unwrap();
-        let e = rec2.unwrap_err();
-        // Ideally this would not be UnexpectedEnd since we know it's an invalid record
-        // but that's for another day
-        assert_eq!(e.kind, ParseErrorKind::UnexpectedEnd);
-    }
-
-    // https://github.com/onecodex/needletail/pull/39
-    #[test]
-    fn test_fastq_with_random_tsv_inside() {
-        let mut reader = Reader::from_path("tests/data/random_tsv.fq").unwrap();
-        let rec = reader.next().unwrap();
-        assert!(rec.is_ok());
-        let rec2 = reader.next().unwrap();
-        let e = rec2.unwrap_err();
-        // It errors when it tries to validate the separator line that needs to start with `+`
-        assert_eq!(e.kind, ParseErrorKind::InvalidSeparator);
-    }
 }
--- needletail.orig/tests/test_compressed.rs
+++ needletail/tests/test_compressed.rs
@@ -37,10 +37,4 @@
     }
 }
 
-#[cfg(not(feature = "compression"))]
-#[test]
-fn errors_on_compressed_files() {
-    for p in &TEST_FILES {
-        assert!(parse_fastx_file(p).is_err());
-    }
-}
+
--- needletail.orig/tests/test_stdin.rs
+++ needletail/tests/test_stdin.rs
@@ -3,138 +3,4 @@
 use assert_cmd::prelude::*;
 use predicates::str::contains;
 
-#[cfg(feature = "compression")]
-#[test]
-fn test_stdin_gz() {
-    // Generated with `echo ">id1\nAGTCGTCA" | gzip -c | xxd  -i`
-    let input: &[u8] = &[
-        0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xb3, 0xcb, 0x4c, 0x31, 0xe4,
-        0x72, 0x74, 0x0f, 0x71, 0x06, 0x22, 0x47, 0x2e, 0x00, 0x9e, 0x3a, 0x32, 0x8c, 0x0e, 0x00,
-        0x00, 0x00,
-    ];
-    let mut file = tempfile::NamedTempFile::new().unwrap();
-    file.write_all(input).unwrap();
-    file.flush().unwrap();
-    file.seek(SeekFrom::Start(0)).unwrap();
 
-    escargot::CargoBuild::new()
-        .example("stdin_pipe")
-        .current_release()
-        .current_target()
-        .run()
-        .unwrap()
-        .command()
-        .stdin(file.into_file())
-        .assert()
-        .success()
-        .stdout(contains("There are 8 bases in your file"))
-        .stdout(contains("There are 0 AAAAs in your file"));
-}
-
-#[cfg(feature = "compression")]
-#[test]
-fn test_stdin_xz() {
-    // Generated with `echo ">id1\nAGTCGTCA" | xz -c | xxd  -i`
-    let input: &[u8] = &[
-        0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04, 0xe6, 0xd6, 0xb4, 0x46, 0x02, 0x00, 0x21,
-        0x01, 0x16, 0x00, 0x00, 0x00, 0x74, 0x2f, 0xe5, 0xa3, 0x01, 0x00, 0x0d, 0x3e, 0x69, 0x64,
-        0x31, 0x0a, 0x41, 0x47, 0x54, 0x43, 0x47, 0x54, 0x43, 0x41, 0x0a, 0x00, 0x00, 0x00, 0x12,
-        0x0f, 0x91, 0x75, 0xef, 0x7b, 0x63, 0x17, 0x00, 0x01, 0x26, 0x0e, 0x08, 0x1b, 0xe0, 0x04,
-        0x1f, 0xb6, 0xf3, 0x7d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a,
-    ];
-    let mut file = tempfile::NamedTempFile::new().unwrap();
-    file.write_all(input).unwrap();
-    file.flush().unwrap();
-    file.seek(SeekFrom::Start(0)).unwrap();
-
-    escargot::CargoBuild::new()
-        .example("stdin_pipe")
-        .current_release()
-        .current_target()
-        .run()
-        .unwrap()
-        .command()
-        .stdin(file.into_file())
-        .assert()
-        .success()
-        .stdout(contains("There are 8 bases in your file"))
-        .stdout(contains("There are 0 AAAAs in your file"));
-}
-
-#[cfg(feature = "compression")]
-#[test]
-fn test_stdin_bzip() {
-    // Generated with `echo ">id1\nAGTCGTCA" | bzip2 -c | xxd  -i`
-    let input: &[u8] = &[
-        0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x9f, 0x9d, 0xf9, 0xa2, 0x00,
-        0x00, 0x01, 0xcf, 0x00, 0x00, 0x10, 0x20, 0x01, 0x28, 0x80, 0x04, 0x00, 0x04, 0x20, 0x20,
-        0x00, 0x22, 0x0c, 0x9a, 0x64, 0x20, 0xc9, 0x88, 0x21, 0x95, 0x8e, 0x82, 0x75, 0x27, 0x8b,
-        0xb9, 0x22, 0x9c, 0x28, 0x48, 0x4f, 0xce, 0xfc, 0xd1, 0x00,
-    ];
-    let mut file = tempfile::NamedTempFile::new().unwrap();
-    file.write_all(input).unwrap();
-    file.flush().unwrap();
-    file.seek(SeekFrom::Start(0)).unwrap();
-
-    escargot::CargoBuild::new()
-        .example("stdin_pipe")
-        .current_release()
-        .current_target()
-        .run()
-        .unwrap()
-        .command()
-        .stdin(file.into_file())
-        .assert()
-        .success()
-        .stdout(contains("There are 8 bases in your file"))
-        .stdout(contains("There are 0 AAAAs in your file"));
-}
-
-#[cfg(feature = "compression")]
-#[test]
-fn test_stdin_zstd() {
-    // Generated with `echo ">id1\nAGTCGTCA" | zstd -c | xxd  -i`
-    let input: &[u8] = &[
-        0x28, 0xb5, 0x2f, 0xfd, 0x04, 0x58, 0x71, 0x00, 0x00, 0x3e, 0x69, 0x64, 0x31, 0x0a, 0x41,
-        0x47, 0x54, 0x43, 0x47, 0x54, 0x43, 0x41, 0x0a, 0x52, 0x9d, 0x37, 0x8d,
-    ];
-    let mut file = tempfile::NamedTempFile::new().unwrap();
-    file.write_all(input).unwrap();
-    file.flush().unwrap();
-    file.seek(SeekFrom::Start(0)).unwrap();
-
-    escargot::CargoBuild::new()
-        .example("stdin_pipe")
-        .current_release()
-        .current_target()
-        .run()
-        .unwrap()
-        .command()
-        .stdin(file.into_file())
-        .assert()
-        .success()
-        .stdout(contains("There are 8 bases in your file"))
-        .stdout(contains("There are 0 AAAAs in your file"));
-}
-
-#[test]
-fn test_stdin_no_compression() {
-    let input: &[u8] = b">id1\nAGTCGTCA";
-    let mut file = tempfile::NamedTempFile::new().unwrap();
-    file.write_all(input).unwrap();
-    file.flush().unwrap();
-    file.seek(SeekFrom::Start(0)).unwrap();
-
-    escargot::CargoBuild::new()
-        .example("stdin_pipe")
-        .current_release()
-        .current_target()
-        .run()
-        .unwrap()
-        .command()
-        .stdin(file.into_file())
-        .assert()
-        .success()
-        .stdout(contains("There are 8 bases in your file"))
-        .stdout(contains("There are 0 AAAAs in your file"));
-}