Skip to content

Commit

Permalink
fix memory reading bug in test
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev authored and bhansconnect committed Sep 29, 2023
1 parent 827dafe commit 3a6ba3e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions crates/compiler/test_gen/src/gen_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1306,11 +1306,12 @@ fn issue_2365_monomorphize_tag_with_non_empty_ext_var_wrapped() {
Single a : [A, B, C]a
Compound a : Single [D, E, F]a
Padding : { a: U64, b: U64, c: U64 }
single : {} -> Result Str (Single *)
single : {} -> Result Padding (Single *)
single = \{} -> Err C
compound : {} -> Result Str (Compound *)
compound : {} -> Result Padding (Compound *)
compound = \{} ->
when single {} is
Ok s -> Ok s
Expand All @@ -1320,8 +1321,10 @@ fn issue_2365_monomorphize_tag_with_non_empty_ext_var_wrapped() {
"#
),
(0, 2), // Err, C
([u8; std::mem::size_of::<RocStr>()], u8),
|(err_tag, wrap_tag): ([u8; std::mem::size_of::<RocStr>()], u8)| (wrap_tag, err_tag[0])
([u8; std::mem::size_of::<(u64, u64, u64)>()], u8),
|(err_tag, wrap_tag): ([u8; std::mem::size_of::<(u64, u64, u64)>()], u8)| (
wrap_tag, err_tag[0]
)
)
}

Expand All @@ -1335,12 +1338,13 @@ fn issue_2365_monomorphize_tag_with_non_empty_ext_var_wrapped_nested() {
Single a : [A, B, C]a
Compound a : Single [D, E, F]a
Padding : { a: U64, b: U64, c: U64 }
main =
single : {} -> Result Str (Single *)
single : {} -> Result Padding (Single *)
single = \{} -> Err C
compound : {} -> Result Str (Compound *)
compound : {} -> Result Padding (Compound *)
compound = \{} ->
when single {} is
Ok s -> Ok s
Expand All @@ -1350,8 +1354,10 @@ fn issue_2365_monomorphize_tag_with_non_empty_ext_var_wrapped_nested() {
"#
),
(0, 2), // Err, C
([u8; std::mem::size_of::<RocStr>()], u8),
|(err_tag, wrap_tag): ([u8; std::mem::size_of::<RocStr>()], u8)| (wrap_tag, err_tag[0])
([u8; std::mem::size_of::<(u64, u64, u64)>()], u8),
|(err_tag, wrap_tag): ([u8; std::mem::size_of::<(u64, u64, u64)>()], u8)| (
wrap_tag, err_tag[0]
)
)
}

Expand Down

0 comments on commit 3a6ba3e

Please sign in to comment.