diff options
| author | Alex Kladov <aleksey.kladov@gmail.com> | 2024-04-16 16:31:29 +0100 |
|---|---|---|
| committer | Alex Kladov <aleksey.kladov@gmail.com> | 2024-04-16 17:17:46 +0100 |
| commit | f852a6fc7d1d193747c776a13f229fa0774052c8 (patch) | |
| tree | 71c1991e4b429828bd75322c6e8204a2f7de485a | |
| parent | 9bd8eee21e2d2425bfd2946849b45b91f1313174 (diff) | |
| download | rust-f852a6fc7d1d193747c776a13f229fa0774052c8.tar.gz rust-f852a6fc7d1d193747c776a13f229fa0774052c8.zip | |
ide: add a new test
| -rw-r--r-- | crates/ide/src/references.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 8eb4bfe6d0d..01af864cdf5 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -351,6 +351,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( r#" |
