mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-04 00:54:36 +00:00
add memory leak valgrind test for freeing boxes
This commit is contained in:
parent
f3abb3b466
commit
ce6e0bec9f
1 changed files with 26 additions and 0 deletions
|
@ -550,3 +550,29 @@ fn joinpoint_nullpointer() {
|
|||
"#
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn freeing_boxes() {
|
||||
valgrind_test(indoc!(
|
||||
r#"
|
||||
(
|
||||
# Without refcounted field
|
||||
a : I32
|
||||
a = 7
|
||||
|> Box.box
|
||||
|> Box.unbox
|
||||
|
||||
# With refcounted field
|
||||
b : Str
|
||||
b =
|
||||
"Testing123. This will definitely be a large string that is on the heap."
|
||||
|> Box.box
|
||||
|> Box.unbox
|
||||
|
||||
a
|
||||
|> Num.toStr
|
||||
|> Str.concat b
|
||||
)
|
||||
"#
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue