fix list elementes being cloned to the wrong place

This commit is contained in:
Folkert 2023-01-14 14:25:23 +01:00
parent 12350410df
commit dca1c665ae
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 70 additions and 5 deletions

View file

@ -975,4 +975,68 @@ mod test {
),
);
}
#[test]
fn foobar() {
run_expect_test(
indoc!(
r#"
interface Test exposes [] imports []
expect
actual : { headers: List U8, body: List U8, x: List U8 }
actual = {
body: [],
headers: [],
x: [],
}
expected : { headers: List U8, body: List U8, x: List U8 }
expected = {
body: [ 42, 43, 44 ],
headers: [15, 16, 17],
x: [115, 116, 117],
}
actual == expected
"#
),
indoc!(
r#"
This expectation failed:
3> expect
4> actual : { headers: List U8, body: List U8, x: List U8 }
5> actual = {
6> body: [],
7> headers: [],
8> x: [],
9> }
10>
11> expected : { headers: List U8, body: List U8, x: List U8 }
12> expected = {
13> body: [ 42, 43, 44 ],
14> headers: [15, 16, 17],
15> x: [115, 116, 117],
16> }
17> actual == expected
When it failed, these variables had these values:
actual : {
body : List (Int Unsigned8),
headers : List (Int Unsigned8),
x : List (Int Unsigned8),
}
actual = { body: [], headers: [], x: [] }
expected : {
body : List (Int Unsigned8),
headers : List (Int Unsigned8),
x : List (Int Unsigned8),
}
expected = { body: [42, 43, 44], headers: [15, 16, 17], x: [115, 116, 117] }
"#
),
);
}
}