mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-11 18:58:24 +03:00
add expected test output
This commit is contained in:
parent
2c9e2524c1
commit
83dc08b3b4
@ -341,7 +341,7 @@ fn jit_to_ast_help<'a, A: ReplApp<'a>>(
|
||||
layout: InLayout<'a>,
|
||||
var: Variable,
|
||||
) -> Expr<'a> {
|
||||
let (newtype_containers, alias_content, raw_var) = unroll_newtypes_and_aliases(env, var);
|
||||
let (newtype_containers, _alias_content, raw_var) = unroll_newtypes_and_aliases(env, var);
|
||||
|
||||
macro_rules! num_helper {
|
||||
($ty:ty) => {
|
||||
@ -1054,7 +1054,7 @@ fn struct_to_ast<'a, 'env, M: ReplAppMemory>(
|
||||
// We'll advance this as we iterate through the fields
|
||||
let mut field_addr = addr;
|
||||
|
||||
// the type checker stores record fiels in alphabetical order
|
||||
// the type checker stores record fields in alphabetical order
|
||||
let alphabetical_fields: Vec<_> = record_fields
|
||||
.sorted_iterator(subs, Variable::EMPTY_RECORD)
|
||||
.map(|(l, field)| {
|
||||
|
@ -1072,6 +1072,29 @@ mod test {
|
||||
r#"
|
||||
This expectation failed:
|
||||
|
||||
8│> expect
|
||||
9│>
|
||||
10│> actual : Request
|
||||
11│> actual = {
|
||||
12│> fieldA: Get,
|
||||
13│> fieldB: "/things?id=2",
|
||||
14│> }
|
||||
15│>
|
||||
16│> expected : Request
|
||||
17│> expected = {
|
||||
18│> fieldA: Get,
|
||||
19│> fieldB: "/things?id=1",
|
||||
20│> }
|
||||
21│> actual == expected
|
||||
|
||||
When it failed, these variables had these values:
|
||||
|
||||
actual : Request
|
||||
actual = { fieldA: Get, fieldB: "/things?id=2" }
|
||||
|
||||
expected : Request
|
||||
expected = { fieldA: Get, fieldB: "/things?id=1" }
|
||||
|
||||
"#
|
||||
),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user