Debian Codegraph @

tests/algorithm_tests.rs

raw symbols SCIP
1 #[cfg(any(feature = "write-floats", feature = "write-integers"))]
2 use lexical_utilrust-analyzer cargo lexical-util 1.0.7 crate/::algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/;
3
4 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
5 #[cfg(any(feature = "write-floats", feature = "write-integers"))]
6 fn copy_to_dest_testrust-analyzer cargo lexical-util 1.0.7 copy_to_dest_test().() {
7 let src = b"12345";
8 let mut dst = [b'0'; 16];
9
10 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(5, algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::copy_to_dstrust-analyzer cargo lexical-util 1.0.7 algorithm/copy_to_dst().(&mut dst, src));
11 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(&dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., src);
12 }
13
14 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
15 #[cfg(any(feature = "write-floats", feature = "write-integers"))]
16 fn ltrim_char_testrust-analyzer cargo lexical-util 1.0.7 ltrim_char_test().() {
17 let w = "0001";
18 let x = "1010";
19 let y = "1.00";
20 let z = "1e05";
21
22 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(w.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'0'), 3);
23 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(x.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'0'), 0);
24 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(x.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'1'), 1);
25 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(y.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'0'), 0);
26 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(y.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'1'), 1);
27 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(z.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'0'), 0);
28 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(z.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'1'), 1);
29 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(algorithmrust-analyzer cargo lexical-util 1.0.7 algorithm/::ltrim_char_countrust-analyzer cargo lexical-util 1.0.7 algorithm/ltrim_char_count().(z.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().(), b'5'), 0);
30 }