add basic_cli parsing based refcount test

This commit is contained in:
Brendan Hansknecht 2024-07-15 09:12:23 -07:00
parent 507d339691
commit 1f5f0956b7
No known key found for this signature in database
GPG key ID: 0EA784685083E75B

View file

@ -828,3 +828,32 @@ fn reset_reuse_alignment_8() {
]
);
}
#[test]
#[cfg(feature = "gen-wasm")]
fn basic_cli_parser() {
assert_refcounts!(
indoc!(
r#"
in =
"d"
|> Str.toUtf8
|> List.keepOks \c -> Str.fromUtf8 [c]
out =
when in is
[alone] -> [alone]
other -> other
List.len out
"#
),
i64,
&[
(StandardRC, Deallocated), // str
(StandardRC, Deallocated), // [c]
(AfterSize, Deallocated), // in
(AfterSize, Deallocated), // out
]
);
}