Debian Codegraph @

tests/test_codeid.rs

raw symbols SCIP
1 use debugidrust-analyzer cargo debugid 0.8.0 crate/::CodeIdrust-analyzer cargo debugid 0.8.0 CodeId#;
2
3 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
4 fn test_newrust-analyzer cargo debugid 0.8.0 test_new().() {
5 let id = CodeIdrust-analyzer cargo debugid 0.8.0 CodeId#::newrust-analyzer cargo debugid 0.8.0 impl#[CodeId]new().("dfb8e43af2423d73a453aeb6a777ef75".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().());
6 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(id.as_strrust-analyzer cargo debugid 0.8.0 impl#[CodeId]as_str().(), "dfb8e43af2423d73a453aeb6a777ef75");
7 }
8
9 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
10 fn test_perust-analyzer cargo debugid 0.8.0 test_pe().() {
11 // Code identifiers of PE files might have an odd length and contain upper case characters.
12 let id = CodeIdrust-analyzer cargo debugid 0.8.0 CodeId#::newrust-analyzer cargo debugid 0.8.0 impl#[CodeId]new().("5CCC38584b08000".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().());
13 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(id.as_strrust-analyzer cargo debugid 0.8.0 impl#[CodeId]as_str().(), "5ccc38584b08000");
14 }
15
16 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
17 fn test_from_binaryrust-analyzer cargo debugid 0.8.0 test_from_binary().() {
18 let binary = b"\xdf\xb8\xe4\x3a\xf2\x42\x3d\x73\xa4\x53\xae\xb6\xa7\x77\xef\x75";
19 let id = CodeIdrust-analyzer cargo debugid 0.8.0 CodeId#::from_binaryrust-analyzer cargo debugid 0.8.0 impl#[CodeId]from_binary().(&binary[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().);
20 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(id.as_strrust-analyzer cargo debugid 0.8.0 impl#[CodeId]as_str().(), "dfb8e43af2423d73a453aeb6a777ef75");
21 }
22
23 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
24 fn test_is_nilrust-analyzer cargo debugid 0.8.0 test_is_nil().() {
25 let id = CodeIdrust-analyzer cargo debugid 0.8.0 CodeId#::nilrust-analyzer cargo debugid 0.8.0 impl#[CodeId]nil().();
26 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(id.is_nilrust-analyzer cargo debugid 0.8.0 impl#[CodeId]is_nil().());
27 }