mirror of https://github.com/tailix/libkernaux.git
Rust: add tests for ntoa prefixes
This commit is contained in:
parent
746d870f14
commit
5bf174eb65
|
@ -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!(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!(utoa2(123), "0b1111011");
|
||||||
assert_eq!(itoa2(123), "0b1111011");
|
assert_eq!(itoa2(123), "0b1111011");
|
||||||
assert_eq!(utoa8(0o123), "0o123");
|
assert_eq!(utoa8(0o123), "0o123");
|
||||||
|
|
Loading…
Reference in New Issue