We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6964a88 commit 6f81a37Copy full SHA for 6f81a37
crates/ra_batch/src/lib.rs
@@ -126,3 +126,27 @@ impl BatchDatabase {
126
Ok((db, local_roots))
127
}
128
129
+
130
+#[cfg(test)]
131
+mod tests {
132
+ use ra_hir::Crate;
133
+ use super::*;
134
135
+ #[test]
136
+ fn test_loading_rust_analyzer() {
137
+ let mut path = std::env::current_exe().unwrap();
138
+ while !path.join("Cargo.toml").is_file() {
139
+ path = path.parent().unwrap().to_owned();
140
+ }
141
+ let (db, roots) = BatchDatabase::load_cargo(path).unwrap();
142
+ let mut num_crates = 0;
143
+ for root in roots {
144
+ for _krate in Crate::source_root_crates(&db, root) {
145
+ num_crates += 1;
146
147
148
149
+ // RA has quite a few crates, but the exact count doesn't matter
150
+ assert!(num_crates > 20);
151
152
+}
0 commit comments