mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
fix bug in expect serialization of lambda sets
This commit is contained in:
parent
52f0dfbaf4
commit
bdec61d5bb
3 changed files with 45 additions and 4 deletions
|
@ -893,4 +893,45 @@ mod test {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn arg_parser() {
|
||||
run_expect_test(
|
||||
indoc!(
|
||||
r#"
|
||||
interface A exposes [] imports []
|
||||
|
||||
makeForcer : {} -> (Str -> U8)
|
||||
makeForcer = \{} -> \_ -> 2u8
|
||||
|
||||
expect
|
||||
forcer = makeForcer {}
|
||||
|
||||
case = ""
|
||||
|
||||
forcer case == 5u8
|
||||
"#
|
||||
),
|
||||
indoc!(
|
||||
r#"
|
||||
This expectation failed:
|
||||
|
||||
6│> expect
|
||||
7│> forcer = makeForcer {}
|
||||
8│>
|
||||
9│> case = ""
|
||||
10│>
|
||||
11│> forcer case == 5u8
|
||||
|
||||
When it failed, these variables had these values:
|
||||
|
||||
forcer : Str -> U8
|
||||
forcer = <function>
|
||||
|
||||
case : Str
|
||||
case = ""
|
||||
"#
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -384,7 +384,7 @@ fn render_expect_failure<'a>(
|
|||
let data = expectations.get_mut(&module_id).unwrap();
|
||||
|
||||
let current = match data.expectations.get(&failure_region) {
|
||||
None => panic!("region not in list of expects"),
|
||||
None => panic!("region {failure_region:?} not in list of expects"),
|
||||
Some(current) => current,
|
||||
};
|
||||
let subs = arena.alloc(&mut data.subs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue