Eliminate itoa::write and itoa::fmt from tests

This commit is contained in:
David Tolnay 2021-12-11 20:44:52 -08:00
parent 865a5517ea
commit 1898210ac6
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 2 additions and 9 deletions

View File

@ -12,15 +12,8 @@ macro_rules! test {
$(#[$attr])* $(#[$attr])*
#[test] #[test]
fn $name() { fn $name() {
#[cfg(feature = "std")] let mut buffer = itoa::Buffer::new();
{ let s = buffer.format($value);
let mut buf = [b'\0'; 40];
let len = itoa::write(&mut buf[..], $value).unwrap();
assert_eq!(&buf[0..len], $expected.as_bytes());
}
let mut s = String::new();
itoa::fmt(&mut s, $value).unwrap();
assert_eq!(s, $expected); assert_eq!(s, $expected);
} }
)* )*