mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 16:30:04 +03:00
Add a RocBox test and pub use it
This commit is contained in:
parent
67bec4828e
commit
a668cd67e0
@ -16,6 +16,7 @@ mod roc_list;
|
|||||||
mod roc_str;
|
mod roc_str;
|
||||||
mod storage;
|
mod storage;
|
||||||
|
|
||||||
|
pub use roc_box::RocBox;
|
||||||
pub use roc_list::RocList;
|
pub use roc_list::RocList;
|
||||||
pub use roc_str::{InteriorNulError, RocStr};
|
pub use roc_str::{InteriorNulError, RocStr};
|
||||||
pub use storage::Storage;
|
pub use storage::Storage;
|
||||||
|
@ -59,7 +59,7 @@ pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test_roc_std {
|
mod test_roc_std {
|
||||||
use roc_std::{RocDec, RocList, RocResult, RocStr};
|
use roc_std::{RocBox, RocDec, RocList, RocResult, RocStr};
|
||||||
|
|
||||||
fn roc_str_byte_representation(string: &RocStr) -> [u8; RocStr::SIZE] {
|
fn roc_str_byte_representation(string: &RocStr) -> [u8; RocStr::SIZE] {
|
||||||
unsafe { core::mem::transmute_copy(string) }
|
unsafe { core::mem::transmute_copy(string) }
|
||||||
@ -189,6 +189,14 @@ mod test_roc_std {
|
|||||||
assert!(roc_result.is_err());
|
assert!(roc_result.is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn create_roc_box() {
|
||||||
|
let contents = 42;
|
||||||
|
let roc_box = RocBox::new(contents);
|
||||||
|
|
||||||
|
assert_eq!(roc_box.into_inner(), contents)
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn roc_dec_fmt() {
|
fn roc_dec_fmt() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
Loading…
Reference in New Issue
Block a user