add commented tests

This commit is contained in:
Folkert 2020-04-05 00:12:41 +02:00
parent 5b0d9e693b
commit 9e331f4a60
2 changed files with 63 additions and 1 deletions

View File

@ -122,7 +122,7 @@ fn to_expr_report(
match expected {
Expected::NoExpectation(expected_type) => todo!("hit no expectation with type {:?}", expected_type),
Expected::FromAnnotation(_name, _arity, _sub_context, _expected_type) => todo!(),
Expected::FromAnnotation(_name, _arity, _sub_context, _expected_type) => todo!("hit from annotation {:?} {:?}",_sub_context, _expected_type ),
Expected::ForReason(reason, expected_type, region) => match reason {
Reason::IfCondition => {
let problem = Concat(vec![

View File

@ -960,6 +960,68 @@ mod test_reporting {
)
}
// needs a bit more infrastructure re. diffing records
// #[test]
// fn record_update_keys() {
// report_problem_as(
// indoc!(
// r#"
// x : { foo : {} }
// x = { foo: {} }
//
// { x & baz: "bar" }
// "#
// ),
// indoc!(
// r#"
// The `x` record does not have a `baz` field
//
// 4 ┆ { x & baz: "bar" }
// ┆ ^^^
//
// This is usually a typo. Here are the `x` fields that are most similar
//
// { foo : {}
// }
//
// So maybe `baz` should be `foo`?
// "#
// ),
// )
// }
// #[test]
// fn num_literal() {
// report_problem_as(
// indoc!(
// r#"
// x : Str
// x = 4
//
// x
// "#
// ),
// indoc!(
// r#"
// Something is off with the body of the `x` definition
//
// 4 ┆ x = 4
// ┆ ^
//
// The body is a number of type
//
// Num a
//
// But the type annotation on `x` says that it should be
//
// Str
//
// instead.
// "#
// ),
// )
// }
#[test]
fn circular_type() {
report_problem_as(