Skip to content

Commit ca00411

Browse files
authored
Remove commented tests for Bytes::unsplit (#677)
Bytes doesn't have an unsplit method anymore. We can always retrieve these from git history if necessary.
1 parent 7968f6f commit ca00411

File tree

1 file changed

+0
-91
lines changed

1 file changed

+0
-91
lines changed

tests/test_bytes.rs

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -732,97 +732,6 @@ fn partial_eq_bytesmut() {
732732
assert!(bytesmut != bytes2);
733733
}
734734

735-
/*
736-
#[test]
737-
fn bytes_unsplit_basic() {
738-
let buf = Bytes::from(&b"aaabbbcccddd"[..]);
739-
740-
let splitted = buf.split_off(6);
741-
assert_eq!(b"aaabbb", &buf[..]);
742-
assert_eq!(b"cccddd", &splitted[..]);
743-
744-
buf.unsplit(splitted);
745-
assert_eq!(b"aaabbbcccddd", &buf[..]);
746-
}
747-
748-
#[test]
749-
fn bytes_unsplit_empty_other() {
750-
let buf = Bytes::from(&b"aaabbbcccddd"[..]);
751-
752-
// empty other
753-
let other = Bytes::new();
754-
755-
buf.unsplit(other);
756-
assert_eq!(b"aaabbbcccddd", &buf[..]);
757-
}
758-
759-
#[test]
760-
fn bytes_unsplit_empty_self() {
761-
// empty self
762-
let mut buf = Bytes::new();
763-
764-
let mut other = Bytes::with_capacity(64);
765-
other.extend_from_slice(b"aaabbbcccddd");
766-
767-
buf.unsplit(other);
768-
assert_eq!(b"aaabbbcccddd", &buf[..]);
769-
}
770-
771-
#[test]
772-
fn bytes_unsplit_arc_different() {
773-
let mut buf = Bytes::with_capacity(64);
774-
buf.extend_from_slice(b"aaaabbbbeeee");
775-
776-
buf.split_off(8); //arc
777-
778-
let mut buf2 = Bytes::with_capacity(64);
779-
buf2.extend_from_slice(b"ccccddddeeee");
780-
781-
buf2.split_off(8); //arc
782-
783-
buf.unsplit(buf2);
784-
assert_eq!(b"aaaabbbbccccdddd", &buf[..]);
785-
}
786-
787-
#[test]
788-
fn bytes_unsplit_arc_non_contiguous() {
789-
let mut buf = Bytes::with_capacity(64);
790-
buf.extend_from_slice(b"aaaabbbbeeeeccccdddd");
791-
792-
let mut buf2 = buf.split_off(8); //arc
793-
794-
let buf3 = buf2.split_off(4); //arc
795-
796-
buf.unsplit(buf3);
797-
assert_eq!(b"aaaabbbbccccdddd", &buf[..]);
798-
}
799-
800-
#[test]
801-
fn bytes_unsplit_two_split_offs() {
802-
let mut buf = Bytes::with_capacity(64);
803-
buf.extend_from_slice(b"aaaabbbbccccdddd");
804-
805-
let mut buf2 = buf.split_off(8); //arc
806-
let buf3 = buf2.split_off(4); //arc
807-
808-
buf2.unsplit(buf3);
809-
buf.unsplit(buf2);
810-
assert_eq!(b"aaaabbbbccccdddd", &buf[..]);
811-
}
812-
813-
#[test]
814-
fn bytes_unsplit_overlapping_references() {
815-
let mut buf = Bytes::with_capacity(64);
816-
buf.extend_from_slice(b"abcdefghijklmnopqrstuvwxyz");
817-
let mut buf0010 = buf.slice(0..10);
818-
let buf1020 = buf.slice(10..20);
819-
let buf0515 = buf.slice(5..15);
820-
buf0010.unsplit(buf1020);
821-
assert_eq!(b"abcdefghijklmnopqrst", &buf0010[..]);
822-
assert_eq!(b"fghijklmno", &buf0515[..]);
823-
}
824-
*/
825-
826735
#[test]
827736
fn bytes_mut_unsplit_basic() {
828737
let mut buf = BytesMut::with_capacity(64);

0 commit comments

Comments
 (0)