mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
fix gen_refcount tests
This commit is contained in:
parent
ad76fa2a4e
commit
a8bef30392
3 changed files with 34 additions and 3 deletions
|
@ -96,13 +96,34 @@ fn list_str_inc() {
|
|||
),
|
||||
RocList<RocList<RocStr>>,
|
||||
&[
|
||||
Live(6), // s
|
||||
Live(3), // s
|
||||
Live(2), // list
|
||||
Live(1) // result
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "gen-wasm")]
|
||||
fn list_str_slice() {
|
||||
assert_refcounts!(
|
||||
indoc!(
|
||||
r#"
|
||||
s = Str.concat "A long enough string " "to be heap-allocated"
|
||||
list = [s, s, s]
|
||||
List.dropFirst list 1
|
||||
"#
|
||||
),
|
||||
RocList<RocList<RocStr>>,
|
||||
&[
|
||||
// Still has 3 refcounts cause the slice holds onto the list.
|
||||
// So nothing in the list is freed yet.
|
||||
Live(3), // s
|
||||
Live(1) // result
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "gen-wasm")]
|
||||
fn list_str_dealloc() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue