Move test specific things

This commit is contained in:
Ville Penttinen 2019-04-04 18:06:22 +03:00
parent 751b454442
commit 84fde47d00
2 changed files with 11 additions and 16 deletions

View File

@ -22,12 +22,6 @@ impl Into<String> for Documentation {
}
}
impl<'a> Into<String> for &'a Documentation {
fn into(self) -> String {
self.contents().into()
}
}
pub trait Docs {
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation>;
}

View File

@ -118,16 +118,6 @@ impl CallInfo {
fn parameters(&self) -> &[String] {
&self.signature.parameters
}
#[cfg(test)]
fn doc(&self) -> Option<&hir::Documentation> {
self.signature.doc.as_ref()
}
#[cfg(test)]
fn label(&self) -> String {
self.signature.to_string()
}
}
#[cfg(test)]
@ -138,6 +128,17 @@ mod tests {
use super::*;
// These are only used when testing
impl CallInfo {
fn doc(&self) -> Option<hir::Documentation> {
self.signature.doc.clone()
}
fn label(&self) -> String {
self.signature.to_string()
}
}
fn call_info(text: &str) -> CallInfo {
let (analysis, position) = single_file_with_position(text);
analysis.call_info(position).unwrap().unwrap()