mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
add expected test output
This commit is contained in:
parent
2c9e2524c1
commit
83dc08b3b4
2 changed files with 25 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue