diff options
author | Aleksey Kladov <[email protected]> | 2020-06-23 17:58:45 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-23 17:58:45 +0100 |
commit | a34f9b7fb343114446be08c7867b699b2210710f (patch) | |
tree | 5c7731289cf96309fb48c24c209d172c3e814cf4 | |
parent | 84cd28fddc89bfa75760e81f4fbc5aa21ce2742c (diff) |
Docs for Fixture
-rw-r--r-- | crates/rust-analyzer/tests/heavy_tests/support.rs | 4 | ||||
-rw-r--r-- | crates/test_utils/src/fixture.rs | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/crates/rust-analyzer/tests/heavy_tests/support.rs b/crates/rust-analyzer/tests/heavy_tests/support.rs index 59565bf3d..e80ffe5d1 100644 --- a/crates/rust-analyzer/tests/heavy_tests/support.rs +++ b/crates/rust-analyzer/tests/heavy_tests/support.rs | |||
@@ -17,7 +17,7 @@ use lsp_types::{ProgressParams, ProgressParamsValue}; | |||
17 | use serde::Serialize; | 17 | use serde::Serialize; |
18 | use serde_json::{to_string_pretty, Value}; | 18 | use serde_json::{to_string_pretty, Value}; |
19 | use tempfile::TempDir; | 19 | use tempfile::TempDir; |
20 | use test_utils::{find_mismatch, parse_fixture}; | 20 | use test_utils::{find_mismatch, Fixture}; |
21 | 21 | ||
22 | use ra_project_model::ProjectManifest; | 22 | use ra_project_model::ProjectManifest; |
23 | use rust_analyzer::{ | 23 | use rust_analyzer::{ |
@@ -68,7 +68,7 @@ impl<'a> Project<'a> { | |||
68 | 68 | ||
69 | let mut paths = vec![]; | 69 | let mut paths = vec![]; |
70 | 70 | ||
71 | for entry in parse_fixture(self.fixture) { | 71 | for entry in Fixture::parse(self.fixture) { |
72 | let path = tmp_dir.path().join(&entry.path['/'.len_utf8()..]); | 72 | let path = tmp_dir.path().join(&entry.path['/'.len_utf8()..]); |
73 | fs::create_dir_all(path.parent().unwrap()).unwrap(); | 73 | fs::create_dir_all(path.parent().unwrap()).unwrap(); |
74 | fs::write(path.as_path(), entry.text.as_bytes()).unwrap(); | 74 | fs::write(path.as_path(), entry.text.as_bytes()).unwrap(); |
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index 44cf835b3..ba00607f2 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -1,3 +1,6 @@ | |||
1 | //! Defines `Fixture` -- a convenient way to describe the initial state of | ||
2 | //! rust-analyzer database from a single string. | ||
3 | |||
1 | use rustc_hash::FxHashMap; | 4 | use rustc_hash::FxHashMap; |
2 | use stdx::split1; | 5 | use stdx::split1; |
3 | 6 | ||