Debian Codegraph @

tests/tests.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
2 fn compile_testrust-analyzer cargo pnet_macros 0.35.0 compile_test().() {
3 let t = trybuildrust-analyzer cargo trybuild 1.0.120 crate/::TestCasesrust-analyzer cargo trybuild 1.0.120 TestCases#::newrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]new().();
•4 //t.compile_fail("tests/compile-fail/*.rs");
5 t.passrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]pass().("tests/run-pass/*.rs");
6 }
7
8 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
9 fn test_vec_primitiverust-analyzer cargo pnet_macros 0.35.0 test_vec_primitive().() {
10 use pnet_macrosrust-analyzer cargo pnet_macros 0.35.0 crate/::packetrust-analyzer cargo pnet_macros 0.35.0 packet:;
11 use pnet_macros_supportrust-analyzer cargo pnet_macros_support 0.35.0 crate/::typesrust-analyzer cargo pnet_macros_support 0.35.0 types/::u32berust-analyzer cargo pnet_macros_support 0.35.0 types/u32be#;
12
13 #[packet]
14 pub struct Testrust-analyzer cargo pnet_macros 0.35.0 Test# {
15 #[lengthrust-analyzer cargo pnet_macros 0.35.0 length: = "4"]
16 pub vrust-analyzer cargo pnet_macros 0.35.0 Test#v.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u32berust-analyzer cargo pnet_macros_support 0.35.0 types/u32be#>,
17 #[payloadrust-analyzer cargo pnet_macros 0.35.0 payload:]
18 #[lengthrust-analyzer cargo pnet_macros 0.35.0 length: = "0"]
19 pub payloadrust-analyzer cargo pnet_macros 0.35.0 Test#payload.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>,
20 }
21
22 let res = TestPacketrust-analyzer cargo pnet_macros 0.35.0 TestPacket#::newrust-analyzer cargo pnet_macros 0.35.0 impl#[`TestPacket<'a>`]new().(&[0x00, 0x00, 0x00, 0x00]).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().();
23 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(res.get_vrust-analyzer cargo pnet_macros 0.35.0 impl#[`TestPacket<'a>`]get_v().(), vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0]);
24 }