1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00

Rust: add tests for ntoa prefixes

This commit is contained in:
Alex Kotov 2022-06-02 13:16:09 +03:00
parent 746d870f14
commit 5bf174eb65
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -21,6 +21,19 @@ mod tests {
assert_eq!(itoa(123, Default::default(), None), Ok("123".into()));
assert_eq!(itoa(-123, Default::default(), None), Ok("-123".into()));
assert_eq!(
utoa(123, Default::default(), Some("foo")),
Ok("foo123".into()),
);
assert_eq!(
itoa(123, Default::default(), Some("foo")),
Ok("foo123".into()),
);
assert_eq!(
itoa(-123, Default::default(), Some("foo")),
Ok("-foo123".into()),
);
assert_eq!(utoa2(123), "0b1111011");
assert_eq!(itoa2(123), "0b1111011");
assert_eq!(utoa8(0o123), "0o123");