From a34f9b7fb343114446be08c7867b699b2210710f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 23 Jun 2020 18:58:45 +0200 Subject: Docs for Fixture --- crates/rust-analyzer/tests/heavy_tests/support.rs | 4 ++-- 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}; use serde::Serialize; use serde_json::{to_string_pretty, Value}; use tempfile::TempDir; -use test_utils::{find_mismatch, parse_fixture}; +use test_utils::{find_mismatch, Fixture}; use ra_project_model::ProjectManifest; use rust_analyzer::{ @@ -68,7 +68,7 @@ impl<'a> Project<'a> { let mut paths = vec![]; - for entry in parse_fixture(self.fixture) { + for entry in Fixture::parse(self.fixture) { let path = tmp_dir.path().join(&entry.path['/'.len_utf8()..]); fs::create_dir_all(path.parent().unwrap()).unwrap(); 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 @@ +//! Defines `Fixture` -- a convenient way to describe the initial state of +//! rust-analyzer database from a single string. + use rustc_hash::FxHashMap; use stdx::split1; -- cgit v1.2.3