Skip to content

Commit 0ecc6a1

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

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
@@ -10644,6 +10644,19 @@ pub fn add_one(thing: Int) {
1064410644
);
1064510645
}
1064610646

10647+
#[test]
10648+
fn annotate_all_top_level_definitions_with_partially_annotated_generic_function() {
10649+
assert_code_action!(
10650+
ANNOTATE_TOP_LEVEL_DEFINITIONS,
10651+
r#"
10652+
pub fn wibble(a: a, b, c: c, d) {
10653+
todo
10654+
}
10655+
"#,
10656+
find_position_of("wibble").to_selection()
10657+
);
10658+
}
10659+
1064710660
#[test]
1064810661
fn annotate_all_top_level_definitions_with_two_generic_functions() {
1064910662
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)