Debian Codegraph @

src/tests/overwrite.rs

raw symbols SCIP
1 use craterust-analyzer cargo ringbuf 0.3.3 crate/::{HeapRbrust-analyzer cargo ringbuf 0.3.3 alias/HeapRb#, LocalRbrust-analyzer cargo ringbuf 0.3.3 ring_buffer/local/LocalRb#, Rbrust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#};
2 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/::Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#;
3 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#;
4
5 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
6 fn pushrust-analyzer cargo ringbuf 0.3.3 tests/overwrite/push().() {
7 let mut rb = HeapRbrust-analyzer cargo ringbuf 0.3.3 alias/HeapRb#::<i32>::newrust-analyzer cargo ringbuf 0.3.3 ring_buffer/init/impl#[`SharedRb<T, Vec<MaybeUninit<T>>>`]new().(2);
8
9 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.push_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_overwrite().(0), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
10 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.push_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_overwrite().(1), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
11 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.push_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_overwrite().(2), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0));
12
13 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.poprust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(1));
14 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.poprust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2));
15 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.poprust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
16 }
17
18 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
19 fn push_iterrust-analyzer cargo ringbuf 0.3.3 tests/overwrite/push_iter().() {
20 let mut rb = HeapRbrust-analyzer cargo ringbuf 0.3.3 alias/HeapRb#::<i32>::newrust-analyzer cargo ringbuf 0.3.3 ring_buffer/init/impl#[`SharedRb<T, Vec<MaybeUninit<T>>>`]new().(2);
21 rb.push_iter_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_iter_overwrite().([0, 1, 2, 3, 4, 5].into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/iter/impl#[`[T; N]`][IntoIterator]into_iter().());
22 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.pop_iterrust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(), [4, 5]);
23 }
24
25 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
26 fn push_slicerust-analyzer cargo ringbuf 0.3.3 tests/overwrite/push_slice().() {
27 let mut rb = HeapRbrust-analyzer cargo ringbuf 0.3.3 alias/HeapRb#::<i32>::newrust-analyzer cargo ringbuf 0.3.3 ring_buffer/init/impl#[`SharedRb<T, Vec<MaybeUninit<T>>>`]new().(2);
28 rb.push_slice_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_slice_overwrite().(&[0, 1, 2, 3, 4, 5]);
29 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.pop_iterrust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(), [4, 5]);
30 }
31
32 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
33 fn push_localrust-analyzer cargo ringbuf 0.3.3 tests/overwrite/push_local().() {
34 let mut rb = LocalRbrust-analyzer cargo ringbuf 0.3.3 ring_buffer/local/LocalRb#::<i32, [MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#<i32>; 2]>::defaultrust-analyzer cargo ringbuf 0.3.3 ring_buffer/init/impl#[`LocalRb<T, [MaybeUninit<T>; N]>`][Default]default().();
35
36 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.push_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_overwrite().(0), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
37 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.push_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_overwrite().(1), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
38 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.push_overwriterust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#push_overwrite().(2), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0));
39
40 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.poprust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(1));
41 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.poprust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2));
42 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(rb.poprust-analyzer cargo ringbuf 0.3.3 ring_buffer/rb/Rb#pop().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
43 }