MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_skip_section

Function test_skip_section

atomic-core/src/change/format_v3/reader/tests.rs:406–421  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

404
405#[test]
406fn test_skip_section() {
407 let (buf, _hash) = write_minimal_change();
408 let mut cursor = Cursor::new(&buf);
409 let mut reader = ChangeReader::open(&mut cursor).unwrap();
410
411 // Skip HEADER
412 assert!(reader.skip_section().unwrap());
413 assert_eq!(reader.stats().sections_skipped, 1);
414
415 // Read DEPS normally
416 let section = reader.next_section().unwrap().unwrap();
417 assert_eq!(section.section_type, SectionType::Dependencies);
418
419 // No more to skip
420 assert!(!reader.skip_section().unwrap());
421}
422
423#[test]
424fn test_skip_all_sections() {

Callers

nothing calls this directly

Calls 3

write_minimal_changeFunction · 0.85
next_sectionMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected