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

Function test_linesplit_position_tracking

atomic-core/src/diff/split.rs:476–492  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

474
475 #[test]
476 fn test_linesplit_position_tracking() {
477 let content = b"aa\nbbb\ncccc\n";
478 let mut split = LineSplit::new(content, &Separator::Newline);
479
480 assert_eq!(split.position(), 0);
481
482 split.next();
483 assert_eq!(split.position(), 3); // "aa\n"
484
485 split.next();
486 assert_eq!(split.position(), 7); // "bbb\n"
487
488 split.next();
489 assert_eq!(split.position(), 12); // "cccc\n"
490
491 assert!(split.is_finished());
492 }
493
494 #[test]
495 fn test_linesplit_size_hint() {

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected