fix memory leak in List.concat

This commit is contained in:
Folkert 2023-01-26 20:31:33 +01:00
parent 212dfdf842
commit 0af11c210e
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 22 additions and 5 deletions

View file

@ -294,3 +294,20 @@ fn str_trim_left_capacity() {
"#
));
}
#[test]
fn str_concat_later_referencing_empty_list_with_capacity() {
valgrind_test(indoc!(
r#"
(
a : List U8
a = List.withCapacity 1
List.concat a [58]
|> List.len
|> Num.addWrap (List.len a)
|> Num.toStr
)
"#
));
}