mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-17 01:05:02 +00:00
fix incorrect element width used for List.append in dev backend
This commit is contained in:
parent
685025a240
commit
bd0cb6338e
2 changed files with 29 additions and 1 deletions
|
@ -821,6 +821,30 @@ fn list_append_longer_list() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn list_append_record() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
[
|
||||
{ name: "foo", content: "cfoo" },
|
||||
{ name: "bar", content: "cbar" },
|
||||
{ name: "baz", content: "cbaz" },
|
||||
]
|
||||
|> List.append { name: "spam", content: "cspam" }
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[
|
||||
(RocStr::from("cfoo"), RocStr::from("foo"),),
|
||||
(RocStr::from("cbar"), RocStr::from("bar"),),
|
||||
(RocStr::from("cbaz"), RocStr::from("baz"),),
|
||||
(RocStr::from("cspam"), RocStr::from("spam"),),
|
||||
]),
|
||||
RocList<(RocStr, RocStr)>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn list_prepend() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue