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 28, 2023
1 parent 35e56c3 commit 31e88e5
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 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,11 @@ 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,
dbg!(err_tag)[0]
)
)
}

Expand All @@ -1335,12 +1339,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 +1355,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 31e88e5

Please sign in to comment.