mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-08 05:30:25 +00:00
matchers: remove tests that directly modify RepoPathTree
I'm going to extract generic map from RepoPathTree, and .get_visit_sets() will be inlined into FilesMatcher/PrefixMatcher. These removed tests should be covered by the corresponding matcher tests.
This commit is contained in:
parent
9a83338079
commit
0153cc1bc7
1 changed files with 0 additions and 47 deletions
|
@ -369,11 +369,6 @@ impl RepoPathTree {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
fn add_dir(&mut self, dir: &RepoPath) {
|
|
||||||
self.add(dir).is_dir = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn add_file(&mut self, file: &RepoPath) {
|
fn add_file(&mut self, file: &RepoPath) {
|
||||||
self.add(file).is_file = true;
|
self.add(file).is_file = true;
|
||||||
}
|
}
|
||||||
|
@ -446,48 +441,6 @@ mod tests {
|
||||||
RepoPath::from_internal_string(value)
|
RepoPath::from_internal_string(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_repo_path_tree_empty() {
|
|
||||||
let tree = RepoPathTree::new();
|
|
||||||
assert_eq!(tree.get_visit_sets(RepoPath::root()), Visit::Nothing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_repo_path_tree_root() {
|
|
||||||
let mut tree = RepoPathTree::new();
|
|
||||||
tree.add_dir(RepoPath::root());
|
|
||||||
assert_eq!(tree.get_visit_sets(RepoPath::root()), Visit::Nothing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_repo_path_tree_dir() {
|
|
||||||
let mut tree = RepoPathTree::new();
|
|
||||||
tree.add_dir(repo_path("dir"));
|
|
||||||
assert_eq!(
|
|
||||||
tree.get_visit_sets(RepoPath::root()),
|
|
||||||
Visit::sets(hashset! {RepoPathComponentBuf::from("dir")}, hashset! {}),
|
|
||||||
);
|
|
||||||
tree.add_dir(repo_path("dir/sub"));
|
|
||||||
assert_eq!(
|
|
||||||
tree.get_visit_sets(repo_path("dir")),
|
|
||||||
Visit::sets(hashset! {RepoPathComponentBuf::from("sub")}, hashset! {}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_repo_path_tree_file() {
|
|
||||||
let mut tree = RepoPathTree::new();
|
|
||||||
tree.add_file(repo_path("dir/file"));
|
|
||||||
assert_eq!(
|
|
||||||
tree.get_visit_sets(RepoPath::root()),
|
|
||||||
Visit::sets(hashset! {RepoPathComponentBuf::from("dir")}, hashset! {}),
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
tree.get_visit_sets(repo_path("dir")),
|
|
||||||
Visit::sets(hashset! {}, hashset! {RepoPathComponentBuf::from("file")}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_nothingmatcher() {
|
fn test_nothingmatcher() {
|
||||||
let m = NothingMatcher;
|
let m = NothingMatcher;
|
||||||
|
|
Loading…
Reference in a new issue