Debian Codegraph @

tests/conversion.rs

raw symbols SCIP
1 #[cfg(test)]
2 mod conversionrust-analyzer cargo notify-rust 4.18.0 conversion/ {
3
4 use notify_rustrust-analyzer cargo notify-rust 4.18.0 crate/::Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#;
5
6 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
7 fn urgency_from_intrust-analyzer cargo notify-rust 4.18.0 conversion/urgency_from_int().() {
8 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<u64>`]from().(0), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Lowrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Low#);
9 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<u64>`]from().(1), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Normalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Normal#);
10 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<u64>`]from().(2), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Criticalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Critical#);
11 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<u64>`]from().(900), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Criticalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Critical#);
12 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<u64>`]from().(u64::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]MAX.), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Criticalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Critical#);
13 }
14
15 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
16 fn urgency_from_option_intrust-analyzer cargo notify-rust 4.18.0 conversion/urgency_from_option_int().() {
17 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<Option<u64>>`]from().(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(0)), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Lowrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Low#);
18 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<Option<u64>>`]from().(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(1)), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Normalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Normal#);
19 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<Option<u64>>`]from().(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Normalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Normal#);
20 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`From<Option<u64>>`]from().(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2)), Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Criticalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Critical#);
21 }
22
23 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
24 fn str_into_urgencyrust-analyzer cargo notify-rust 4.18.0 conversion/str_into_urgency().() {
25 let u0: Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency# = "low".try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
26 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(u0, Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Lowrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Low#);
27 }
28
29 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
30 fn urgency_from_strrust-analyzer cargo notify-rust 4.18.0 conversion/urgency_from_str().() {
31 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::try_fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`TryFrom<&str>`]try_from().("low").okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Lowrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Low#));
32 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::try_fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`TryFrom<&str>`]try_from().("medium").okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Normalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Normal#));
33 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::try_fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`TryFrom<&str>`]try_from().("Normal").okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Normalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Normal#));
34 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::try_fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`TryFrom<&str>`]try_from().("NoRmaL").okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Normalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Normal#));
35 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::try_fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`TryFrom<&str>`]try_from().("High").okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Criticalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Critical#));
36 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::try_fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`TryFrom<&str>`]try_from().("Hi").okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Criticalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Critical#));
37 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::try_fromrust-analyzer cargo notify-rust 4.18.0 urgency/impl#[Urgency][`TryFrom<&str>`]try_from().("Critical").okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Urgencyrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#::Criticalrust-analyzer cargo notify-rust 4.18.0 urgency/Urgency#Critical#));
38 }
39 }