Adjust test-texts in infer_function_return_type

This commit is contained in:
Lukas Wirth 2020-11-06 21:51:15 +01:00
parent 4f0d02c276
commit 186431e178

View File

@ -125,10 +125,10 @@ fn infer_return_type_specified_inferred() {
infer_function_return_type,
r#"fn foo() -> <|>_ {
45
}"#,
}"#,
r#"fn foo() -> i32 {
45
}"#,
}"#,
);
}
@ -139,10 +139,10 @@ fn infer_return_type_specified_inferred_closure() {
infer_function_return_type,
r#"fn foo() {
|| -> _ {<|>45};
}"#,
}"#,
r#"fn foo() {
|| -> i32 {45};
}"#,
}"#,
);
}
@ -153,10 +153,10 @@ fn infer_return_type_cursor_at_return_type_pos() {
infer_function_return_type,
r#"fn foo() <|>{
45
}"#,
}"#,
r#"fn foo() -> i32 {
45
}"#,
}"#,
);
}
@ -167,10 +167,10 @@ fn infer_return_type_cursor_at_return_type_pos_closure() {
infer_function_return_type,
r#"fn foo() {
|| <|>45
}"#,
}"#,
r#"fn foo() {
|| -> i32 {45}
}"#,
}"#,
);
}
@ -181,10 +181,10 @@ fn infer_return_type() {
infer_function_return_type,
r#"fn foo() {
45<|>
}"#,
}"#,
r#"fn foo() -> i32 {
45
}"#,
}"#,
);
}
@ -198,14 +198,14 @@ fn infer_return_type_nested() {
} else {
5
}
}"#,
}"#,
r#"fn foo() -> i32 {
if true {
3
} else {
5
}
}"#,
}"#,
);
}
@ -216,7 +216,7 @@ fn not_applicable_ret_type_specified() {
infer_function_return_type,
r#"fn foo() -> i32 {
( 45<|> + 32 ) * 123
}"#,
}"#,
);
}
@ -227,7 +227,7 @@ fn not_applicable_non_tail_expr() {
r#"fn foo() {
let x = <|>3;
( 45 + 32 ) * 123
}"#,
}"#,
);
}
@ -237,7 +237,7 @@ fn not_applicable_unit_return_type() {
infer_function_return_type,
r#"fn foo() {
(<|>)
}"#,
}"#,
);
}
@ -250,12 +250,12 @@ fn infer_return_type_closure_block() {
|x: i32| {
x<|>
};
}"#,
}"#,
r#"fn foo() {
|x: i32| -> i32 {
x
};
}"#,
}"#,
);
}
@ -265,10 +265,10 @@ fn infer_return_type_closure() {
infer_function_return_type,
r#"fn foo() {
|x: i32| { x<|> };
}"#,
}"#,
r#"fn foo() {
|x: i32| -> i32 { x };
}"#,
}"#,
);
}
@ -279,10 +279,10 @@ fn infer_return_type_closure_wrap() {
infer_function_return_type,
r#"fn foo() {
|x: i32| x<|>;
}"#,
}"#,
r#"fn foo() {
|x: i32| -> i32 {x};
}"#,
}"#,
);
}
@ -298,7 +298,7 @@ fn infer_return_type_nested_closure() {
5
}
}
}"#,
}"#,
r#"fn foo() {
|| -> i32 {
if true {
@ -307,7 +307,7 @@ fn infer_return_type_nested_closure() {
5
}
}
}"#,
}"#,
);
}
@ -318,7 +318,7 @@ fn not_applicable_ret_type_specified_closure() {
infer_function_return_type,
r#"fn foo() {
|| -> i32 { 3<|> }
}"#,
}"#,
);
}
@ -331,7 +331,7 @@ fn not_applicable_non_tail_expr_closure() {
let x = 3<|>;
6
}
}"#,
}"#,
);
}
}