mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
fix dev-wasm ListGetUnsafe refcounting
This commit is contained in:
parent
5d613cd5f5
commit
0d083bc192
2 changed files with 20 additions and 7 deletions
|
@ -179,6 +179,26 @@ fn list_str_slice() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "gen-wasm")]
|
||||
fn list_get() {
|
||||
assert_refcounts!(
|
||||
indoc!(
|
||||
r#"
|
||||
s = Str.concat "A long enough string " "to be heap-allocated"
|
||||
i1 = [s, s, s]
|
||||
List.get i1 1
|
||||
|> Result.withDefault ""
|
||||
"#
|
||||
),
|
||||
RocStr,
|
||||
&[
|
||||
(StandardRC, Live(1)), // s
|
||||
(AfterSize, Deallocated), // i1
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "gen-wasm")]
|
||||
fn list_map() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue