mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
use capacity instead of length in list deinit
This commit is contained in:
parent
b8a6e05ed9
commit
4e5b106f98
3 changed files with 40 additions and 9 deletions
|
@ -193,6 +193,22 @@ fn list_concat_consumes_first_argument() {
|
|||
valgrind_test("List.concat (List.withCapacity 1024) [1,2,3] |> List.len |> Num.toStr");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_concat_consumes_second_argument() {
|
||||
valgrind_test(indoc!(
|
||||
r#"
|
||||
(
|
||||
a : List U8
|
||||
a = []
|
||||
b = List.reserve [] 11
|
||||
List.concat a b
|
||||
|> List.len
|
||||
|> Num.toStr
|
||||
)
|
||||
"#
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn str_capacity_concat() {
|
||||
valgrind_test(r#"Str.withCapacity 42 |> Str.concat "foobar""#);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue