mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
add commented tests
This commit is contained in:
parent
5b0d9e693b
commit
9e331f4a60
@ -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![
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user