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:
parent
746d870f14
commit
5bf174eb65
1 changed files with 13 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue