Skip to content

Commit d954581

Browse files
committed
test: add new test with partially annotated generic function
1 parent b61df44 commit d954581

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
@@ -10851,6 +10851,19 @@ pub fn add_one(thing: Int) {
1085110851
);
1085210852
}
1085310853

10854+
#[test]
10855+
fn annotate_all_top_level_definitions_with_partially_annotated_generic_function() {
10856+
assert_code_action!(
10857+
ANNOTATE_TOP_LEVEL_DEFINITIONS,
10858+
r#"
10859+
pub fn wibble(a: a, b, c: c, d) {
10860+
todo
10861+
}
10862+
"#,
10863+
find_position_of("wibble").to_selection()
10864+
);
10865+
}
10866+
1085410867
#[test]
1085510868
fn annotate_all_top_level_definitions_with_two_generic_functions() {
1085610869
assert_code_action!(
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)