diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-20 17:31:37 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-20 17:31:37 +0100 |
commit | e4a58ee1f4ad51d15c5a3de60d5846ffec51b771 (patch) | |
tree | 08d33236442df682b14f6ba7880857be200e93bd /crates/ra_hir/src | |
parent | 4ad2e4ce4e88c809abc7a8006d306fb038eb2d18 (diff) | |
parent | 82751f8a4ae2f126f5bcc601521659445b1cc83a (diff) |
Merge #1176
1176: Add a simple test for str method completion r=flodiebold a=flodiebold
Somehow I forgot that we should add a test for this in #1154 until after it was already merging. So I'll just add one now :)
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 8d8a0eaaa..86f18b487 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -627,6 +627,28 @@ fn test(a: A) { | |||
627 | } | 627 | } |
628 | 628 | ||
629 | #[test] | 629 | #[test] |
630 | fn infer_inherent_method_str() { | ||
631 | assert_snapshot_matches!( | ||
632 | infer(r#" | ||
633 | #[lang = "str"] | ||
634 | impl str { | ||
635 | fn foo(&self) -> i32 {} | ||
636 | } | ||
637 | |||
638 | fn test() { | ||
639 | "foo".foo(); | ||
640 | } | ||
641 | "#), | ||
642 | @r###" | ||
643 | [40; 44) 'self': &str | ||
644 | [53; 55) '{}': () | ||
645 | [69; 89) '{ ...o(); }': () | ||
646 | [75; 80) '"foo"': &str | ||
647 | [75; 86) '"foo".foo()': i32"### | ||
648 | ); | ||
649 | } | ||
650 | |||
651 | #[test] | ||
630 | fn infer_tuple() { | 652 | fn infer_tuple() { |
631 | assert_snapshot_matches!( | 653 | assert_snapshot_matches!( |
632 | infer(r#" | 654 | infer(r#" |