Skip to content

Commit

Permalink
add new test
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Apr 16, 2024
1 parent 15dd02f commit a0fb06e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/ide/src/references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,27 @@ fn test() {
);
}

#[test]
fn test_access() {
check(
r#"
struct S { f$0: u32 }
#[test]
fn test() {
let mut x = S { f: 92 };
x.f = 92;
}
"#,
expect![[r#"
f Field FileId(0) 11..17 11..12
FileId(0) 61..62 read test
FileId(0) 76..77 write test
"#]],
);
}

#[test]
fn test_struct_literal_after_space() {
check(
Expand Down

0 comments on commit a0fb06e

Please sign in to comment.