MCPcopy Create free account
hub / github.com/daniel-e/rustml / test_read_gzip

Function test_read_gzip

src/io.rs:216–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214
215 #[test]
216 fn test_read_gzip() {
217
218 assert_eq!(
219 String::from_utf8(
220 GzipData::from_file("datasets/testing/hello_world.gz").unwrap().into_bytes()).unwrap(),
221 "hello world".to_string()
222 );
223
224 assert_eq!(GzipData::from_file("datasets/testing/hello_world.gz").unwrap().len(), 11);
225 assert!(GzipData::from_file("datasets/testing/random.data").is_err());
226
227 let mut data = GzipData::from_file("datasets/testing/hello_world.gz").unwrap();
228 let mut v: Vec<u8> = Vec::new();
229 assert!(data.read_to_end(&mut v).is_ok());
230 assert_eq!(String::from_utf8(v).unwrap(), "hello world".to_string());
231 }
232
233 #[test]
234 fn test_match_lines() {

Callers

nothing calls this directly

Calls 1

from_fileFunction · 0.85

Tested by

no test coverage detected