Benign cargo Download

test_bytes.rs

Rust test marker or harness
SHA-2569ac6326ceddb4546ead3197810beb32b1a3372279a92dc0ed31c401f15807987
MaleculeMd(Pa)

Evidence

imports bytes::BufMut lines 1–6
1extern crate bytes;
2
3use bytes::{Bytes, BytesMut, BufMut};
4
5const LONG: &'static [u8] = b"mary had a little lamb, little lamb, little lamb";
6const SHORT: &'sta …
imports std::mem lines 6–24
6:34… llo world";
7
8fn inline_cap() -> usize {
9 use std::mem;
10 4 * mem::size_of::<usize>() - 1
11}
12
13fn is_sync<T: Sync>() {}
14fn is_send<T: Send>() {}
15
16#[test]
17fn test_bounds() {
18 is_sync::<Bytes>();
⋯6 lines
imports std::fmt::Write lines 51–60
51:11… _eq!(a, b);
52}
53
54#[test]
55fn fmt_write() {
56 use std::fmt::Write;
57 use std::iter::FromIterator;
58 let s = String::from_iter((0..10).map(|_| "abcdefg"));
59
60 let mut a = BytesMut::with_cap …
imports std::panic lines 276–285
276:35… 30, 40]);
277 bytes.freeze()
278 }
279
280 use std::panic;
281
282 make_bytes().split_to(4);
283 make_bytes().split_off(4);
284
285 assert!(panic::catch_unwind …
imports std::sync::Arc lines 527–535
527:52… d in a concurrent situation
528 use std::sync::{Arc, Barrier};
529 use std::thread;
530
531 const THREADS: usize = 8;
⋯4 lines

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.