diff options
Diffstat (limited to 'crates/test_utils')
-rw-r--r-- | crates/test_utils/src/fixture.rs | 13 | ||||
-rw-r--r-- | crates/test_utils/src/lib.rs | 2 |
2 files changed, 1 insertions, 14 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index bda826d50..25d80806b 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -13,19 +13,6 @@ pub struct FixtureEntry { | |||
13 | pub env: FxHashMap<String, String>, | 13 | pub env: FxHashMap<String, String>, |
14 | } | 14 | } |
15 | 15 | ||
16 | /// Same as `parse_fixture`, except it allow empty fixture | ||
17 | pub fn parse_single_fixture(ra_fixture: &str) -> Option<FixtureEntry> { | ||
18 | if !ra_fixture.lines().any(|it| it.trim_start().starts_with("//-")) { | ||
19 | return None; | ||
20 | } | ||
21 | |||
22 | let fixtures = parse_fixture(ra_fixture); | ||
23 | if fixtures.len() > 1 { | ||
24 | panic!("too many fixtures"); | ||
25 | } | ||
26 | fixtures.into_iter().nth(0) | ||
27 | } | ||
28 | |||
29 | /// Parses text which looks like this: | 16 | /// Parses text which looks like this: |
30 | /// | 17 | /// |
31 | /// ```not_rust | 18 | /// ```not_rust |
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index 0fdd1a36b..d44b2f9ab 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs | |||
@@ -22,7 +22,7 @@ pub use difference::Changeset as __Changeset; | |||
22 | pub use ra_cfg::CfgOptions; | 22 | pub use ra_cfg::CfgOptions; |
23 | pub use rustc_hash::FxHashMap; | 23 | pub use rustc_hash::FxHashMap; |
24 | 24 | ||
25 | pub use crate::fixture::{parse_fixture, parse_single_fixture, FixtureEntry}; | 25 | pub use crate::fixture::{parse_fixture, FixtureEntry}; |
26 | 26 | ||
27 | pub const CURSOR_MARKER: &str = "<|>"; | 27 | pub const CURSOR_MARKER: &str = "<|>"; |
28 | 28 | ||