aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests/display_source_code.rs
blob: ca17486152e2be017b9baa498cdc5c6dc8c3965a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use super::displayed_source_at_pos;
use crate::test_db::TestDB;
use ra_db::fixture::WithFixture;

#[test]
fn qualify_path_to_submodule() {
    let (db, pos) = TestDB::with_position(
        r#"
//- /main.rs

mod foo {
    pub struct Foo;
}

fn bar() {
    let foo: foo::Foo = foo::Foo;
    foo<|>
}

"#,
    );
    assert_eq!("foo::Foo", displayed_source_at_pos(&db, pos));
}