Skip to content

Commit 0e1691b

Browse files
committed
test: add new test with partially annotated generic function
1 parent eed04b3 commit 0e1691b

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

compiler-core/src/language_server/tests/action.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10793,6 +10793,19 @@ pub fn add_one(thing: Int) {
1079310793
);
1079410794
}
1079510795

10796+
#[test]
10797+
fn annotate_all_top_level_definitions_with_partially_annotated_generic_function() {
10798+
assert_code_action!(
10799+
ANNOTATE_TOP_LEVEL_DEFINITIONS,
10800+
r#"
10801+
pub fn wibble(a: a, b, c: c, d) {
10802+
todo
10803+
}
10804+
"#,
10805+
find_position_of("wibble").to_selection()
10806+
);
10807+
}
10808+
1079610809
#[test]
1079710810
fn annotate_all_top_level_definitions_with_two_generic_functions() {
1079810811
assert_code_action!(
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
source: compiler-core/src/language_server/tests/action.rs
3+
expression: "\npub fn wibble(a: a, b, c: c, d) {\n todo\n}\n"
4+
---
5+
----- BEFORE ACTION
6+
7+
pub fn wibble(a: a, b, c: c, d) {
8+
9+
todo
10+
}
11+
12+
13+
----- AFTER ACTION
14+
15+
pub fn wibble(a: a, b: b, c: c, d: d) -> e {
16+
todo
17+
}

0 commit comments

Comments
 (0)