diff options
author | Seivan Heidari <[email protected]> | 2019-11-15 15:30:21 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-15 15:30:21 +0000 |
commit | cb26df950699586b314731fb70786e0db8eaa049 (patch) | |
tree | 29a1fd853757824572bfebc956d20458d827926f /crates/ra_db/src | |
parent | c622413bc72ea56d5f62a16788d897cb61eca948 (diff) | |
parent | c6f05abfbbfa2fd1ff06e1adeea7885151aaa768 (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r-- | crates/ra_db/src/fixture.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index ee883b615..ade187629 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs | |||
@@ -8,8 +8,8 @@ use rustc_hash::FxHashMap; | |||
8 | use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER}; | 8 | use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER}; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | CrateGraph, Edition, FileId, FilePosition, RelativePathBuf, SourceDatabaseExt, SourceRoot, | 11 | CrateGraph, CrateId, Edition, FileId, FilePosition, RelativePathBuf, SourceDatabaseExt, |
12 | SourceRootId, | 12 | SourceRoot, SourceRootId, |
13 | }; | 13 | }; |
14 | 14 | ||
15 | pub const WORKSPACE: SourceRootId = SourceRootId(0); | 15 | pub const WORKSPACE: SourceRootId = SourceRootId(0); |
@@ -33,6 +33,14 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static { | |||
33 | let pos = with_files(&mut db, fixture); | 33 | let pos = with_files(&mut db, fixture); |
34 | (db, pos.unwrap()) | 34 | (db, pos.unwrap()) |
35 | } | 35 | } |
36 | |||
37 | fn test_crate(&self) -> CrateId { | ||
38 | let crate_graph = self.crate_graph(); | ||
39 | let mut it = crate_graph.iter(); | ||
40 | let res = it.next().unwrap(); | ||
41 | assert!(it.next().is_none()); | ||
42 | res | ||
43 | } | ||
36 | } | 44 | } |
37 | 45 | ||
38 | impl<DB: SourceDatabaseExt + Default + 'static> WithFixture for DB {} | 46 | impl<DB: SourceDatabaseExt + Default + 'static> WithFixture for DB {} |