fix syntax errors in tests

This commit is contained in:
Aleksey Kladov 2019-05-28 18:07:39 +03:00
parent 2e3f5af9d4
commit c8bcfe6a05
7 changed files with 137 additions and 121 deletions

View file

@ -190,7 +190,7 @@ mod tests {
};
let (db, _source_root, file_id) = MockDatabase::with_single_file(&code);
let file = db.parse(file_id);
let file = db.parse(file_id).ok().unwrap();
let marker: &ast::PathExpr = find_node_at_offset(file.syntax(), off).unwrap();
let analyzer = SourceAnalyzer::new(&db, file_id, marker.syntax(), None);
@ -288,7 +288,7 @@ mod tests {
let (off, code) = extract_offset(code);
let (db, _source_root, file_id) = MockDatabase::with_single_file(&code);
let file = db.parse(file_id);
let file = db.parse(file_id).ok().unwrap();
let expected_name = find_node_at_offset::<ast::Name>(file.syntax(), expected_offset.into())
.expect("failed to find a name at the target offset");
let name_ref: &ast::NameRef = find_node_at_offset(file.syntax(), off).unwrap();