Skip to content

Commit

Permalink
remove unused tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Schottkyc137 committed Sep 9, 2023
1 parent fe888fa commit 4588cd0
Showing 1 changed file with 0 additions and 71 deletions.
71 changes: 0 additions & 71 deletions vhdl_lang/src/analysis/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,77 +60,6 @@ impl<'a> Searcher for RegionSearcher<'a> {
}
}

#[cfg(test)]
mod region_searcher_test {
use super::*;
use crate::analysis::tests::LibraryBuilder;

#[test]
pub fn test_searcher_finds_region() {
let mut builder = LibraryBuilder::new();
let code = builder.code(
"work",
"\
entity my_ent is
end entity;
architecture arch of my_ent is
signal x: natural := 4;
begin
end;
",
);
let (root, _) = builder.get_analyzed_root();
let mut searcher = RegionSearcher::new(Position::new(4, 12), code.source());
let _ = root.search(&mut searcher);
assert_eq!(searcher.region(), Some(RegionCategory::Declarative));
searcher = RegionSearcher::new(Position::new(6, 0), code.source());
assert_eq!(searcher.region(), None);
}

#[test]
pub fn test_searcher_finds_specific_region() {
let mut builder = LibraryBuilder::new();
let code = builder.code(
"work",
"\
entity my_ent is
end entity;
architecture arch of my_ent is
procedure my_proc is
variable x: bit := '0';
begin
x := '1';
x := '1';
end procedure;
begin
end;
",
);
let (root, _) = builder.get_analyzed_root();
let mut searcher = RegionSearcher::new(Position::new(5, 10), code.source());
let _ = root.search(&mut searcher);
assert_eq!(searcher.region(), Some(RegionCategory::Declarative));
searcher = RegionSearcher::new(Position::new(7, 12), code.source());
let _ = root.search(&mut searcher);
assert_eq!(
searcher.region(),
Some(RegionCategory::SequentialStatements)
);
searcher = RegionSearcher::new(Position::new(8, 0), code.source());
let _ = root.search(&mut searcher);
assert_eq!(
searcher.region(),
Some(RegionCategory::SequentialStatements)
);
}
}

macro_rules! kind {
($kind: pat) => {
Token { kind: $kind, .. }
Expand Down

0 comments on commit 4588cd0

Please sign in to comment.