add expected test output

This commit is contained in:
Folkert 2023-01-14 15:13:26 +01:00
parent 2c9e2524c1
commit 83dc08b3b4
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
2 changed files with 25 additions and 2 deletions

View File

@ -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)| {

View File

@ -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" }
"#
),
);