Vendor dependencies

This commit is contained in:
2026-08-01 16:11:49 +03:00
parent 7f139a0241
commit 6b5e7f0f8b
29706 changed files with 9575646 additions and 0 deletions
@@ -0,0 +1,30 @@
#[cfg(any(feature = "write-floats", feature = "write-integers"))]
use lexical_util::algorithm;
#[test]
#[cfg(any(feature = "write-floats", feature = "write-integers"))]
fn copy_to_dest_test() {
let src = b"12345";
let mut dst = [b'0'; 16];
assert_eq!(5, algorithm::copy_to_dst(&mut dst, src));
assert_eq!(&dst[..5], src);
}
#[test]
#[cfg(any(feature = "write-floats", feature = "write-integers"))]
fn ltrim_char_test() {
let w = "0001";
let x = "1010";
let y = "1.00";
let z = "1e05";
assert_eq!(algorithm::ltrim_char_count(w.as_bytes(), b'0'), 3);
assert_eq!(algorithm::ltrim_char_count(x.as_bytes(), b'0'), 0);
assert_eq!(algorithm::ltrim_char_count(x.as_bytes(), b'1'), 1);
assert_eq!(algorithm::ltrim_char_count(y.as_bytes(), b'0'), 0);
assert_eq!(algorithm::ltrim_char_count(y.as_bytes(), b'1'), 1);
assert_eq!(algorithm::ltrim_char_count(z.as_bytes(), b'0'), 0);
assert_eq!(algorithm::ltrim_char_count(z.as_bytes(), b'1'), 1);
assert_eq!(algorithm::ltrim_char_count(z.as_bytes(), b'5'), 0);
}