Skip to content

Commit a243b0d

Browse files
ankddevlpil
authored andcommitted
test: add new test with partially annotated generic function
1 parent 2787783 commit a243b0d

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
@@ -11273,6 +11273,19 @@ pub fn add_one(thing: Int) {
1127311273
);
1127411274
}
1127511275

11276+
#[test]
11277+
fn annotate_all_top_level_definitions_with_partially_annotated_generic_function() {
11278+
assert_code_action!(
11279+
ANNOTATE_TOP_LEVEL_DEFINITIONS,
11280+
r#"
11281+
pub fn wibble(a: a, b, c: c, d) {
11282+
todo
11283+
}
11284+
"#,
11285+
find_position_of("wibble").to_selection()
11286+
);
11287+
}
11288+
1127611289
#[test]
1127711290
fn annotate_all_top_level_definitions_with_two_generic_functions() {
1127811291
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)