mirror of
https://github.com/tailix/libkernaux.git
synced 2024-10-30 11:54:01 -04:00
Rust: add test
This commit is contained in:
parent
dd5c045d4c
commit
de8f417fc2
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,12 @@ mod tests {
|
|||
let result =
|
||||
unsafe { CStr::from_ptr(buffer.as_ptr()) }.to_str().unwrap();
|
||||
assert_eq!(result, "123");
|
||||
|
||||
let mut buffer: [i8; 1000] = [0; 1000];
|
||||
unsafe { kernaux_itoa(-0x123, buffer.as_mut_ptr(), 'x' as c_int) };
|
||||
let result =
|
||||
unsafe { CStr::from_ptr(buffer.as_ptr()) }.to_str().unwrap();
|
||||
assert_eq!(result, "-123");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue