Debian Codegraph @

tests/337_value_float_roundtrip.rs

raw symbols SCIP
1 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
2 fn roundtrip_value_float_with_decimalsrust-analyzer cargo ron 0.12.0 roundtrip_value_float_with_decimals().() {
3 let v: ronrust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value# = ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("1.0").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
4
5 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(v, ronrust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(1.0_f32.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()));
6
7 let ser = ronrust-analyzer cargo ron 0.12.0 crate/::serrust-analyzer cargo ron 0.12.0 ser/::to_stringrust-analyzer cargo ron 0.12.0 ser/to_string().(&v).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
8
9 let roundtrip = ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().(&ser).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
10
11 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(v, roundtrip);
12 }
13
14 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
15 #[allow(clippy::float_cmp)]
16 fn roundtrip_value_float_intorust-analyzer cargo ron 0.12.0 roundtrip_value_float_into().() {
17 let v: ronrust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value# = ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().("1.0").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
18 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(v, ronrust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(1.0_f32.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()));
19
20 let ser = ronrust-analyzer cargo ron 0.12.0 crate/::serrust-analyzer cargo ron 0.12.0 ser/::to_stringrust-analyzer cargo ron 0.12.0 ser/to_string().(&v).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
21
22 let f1: f64 = ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().(&ser).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
23 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f1, 1.0_f64);
24
25 let roundtrip: ronrust-analyzer cargo ron 0.12.0 crate/::Valuerust-analyzer cargo ron 0.12.0 value/Value# = ronrust-analyzer cargo ron 0.12.0 crate/::from_strrust-analyzer cargo ron 0.12.0 de/from_str().(&ser).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
26
27 let f2: f64 = roundtrip.into_rustrust-analyzer cargo ron 0.12.0 value/impl#[Value]into_rust().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
28 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f2, 1.0_f64);
29 }