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
1 changed files with 13 additions and 0 deletions

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");