Remove duplication

This commit is contained in:
Aleksey Kladov 2020-06-24 11:31:30 +02:00
parent c6795fb83a
commit c749fe223b
8 changed files with 34 additions and 41 deletions

View file

@ -315,12 +315,12 @@ fn adj_comments(comment: &ast::Comment, dir: Direction) -> ast::Comment {
#[cfg(test)]
mod tests {
use crate::mock_analysis::single_file_with_position;
use crate::mock_analysis::analysis_and_position;
use super::*;
fn do_check(before: &str, afters: &[&str]) {
let (analysis, position) = single_file_with_position(&before);
let (analysis, position) = analysis_and_position(&before);
let before = analysis.file_text(position.file_id).unwrap();
let range = TextRange::empty(position.offset);
let mut frange = FileRange { file_id: position.file_id, range };