aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2023-04-05 17:57:37 -0500
committerToby Vincent <tobyv13@gmail.com>2023-04-20 14:50:39 -0500
commitbf58ceab696347f9917f14a5e6a63d8503d28b00 (patch)
tree6161f072d41b5ee6e344ef47395580ceb2fbfb3e
parent9c215b6c379ef954f54c23e8ff32ecd3d0581c2f (diff)
test: remove broken unit testv0.2.1
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/search.rs55
3 files changed, 2 insertions, 57 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ba2ee8f..465e909 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -799,7 +799,7 @@ dependencies = [
[[package]]
name = "projectr"
-version = "0.1.0"
+version = "0.2.1"
dependencies = [
"anyhow",
"clap",
diff --git a/Cargo.toml b/Cargo.toml
index 987c876..ae19f83 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "projectr"
-version = "0.1.0"
+version = "0.2.1"
edition = "2021"
authors = ["Toby Vincent <tobyv13@gmail.com>"]
homepage = "https://sr.ht/~tobyvin/tmuxr"
diff --git a/src/search.rs b/src/search.rs
index fc794ea..6b30293 100644
--- a/src/search.rs
+++ b/src/search.rs
@@ -44,58 +44,3 @@ impl Iterator for Search {
}
}
}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use pretty_assertions::assert_eq;
- use std::{fs, path::PathBuf};
-
- #[test]
- fn test_iteration() {
- let temp_dir = tempfile::Builder::new()
- .tempdir()
- .unwrap()
- .path()
- .to_owned();
-
- let project_dir = temp_dir.join("project_dir");
- let project1 = temp_dir.join("project_dir/project1");
- let project2 = temp_dir.join("project_dir/project2");
- let project3 = temp_dir.join("project3");
- let project4 = temp_dir.join("subdir/project4");
-
- let paths = Search::from(Vec::from([
- SearchEntryConfig {
- path_buf: project_dir.to_owned(),
- max_depth: Some(1),
- ..Default::default()
- },
- SearchEntryConfig {
- path_buf: project3.to_owned(),
- max_depth: Some(0),
- ..Default::default()
- },
- SearchEntryConfig {
- path_buf: project4.to_owned(),
- max_depth: Some(0),
- ..Default::default()
- },
- ]));
-
- let mut path_bufs = Vec::from([project_dir, project1, project2, project3, project4]);
- path_bufs.iter().try_for_each(fs::create_dir_all).unwrap();
- path_bufs.sort();
-
- let mut results = paths.into_iter().collect::<Vec<ProjectItem>>();
-
- results.sort_unstable_by_key(|p| *p.timestamp());
-
- let results = results
- .into_iter()
- .map(|p| p.to_path_buf().to_owned())
- .collect::<Vec<PathBuf>>();
-
- assert_eq!(path_bufs, results);
- }
-}