aboutsummaryrefslogtreecommitdiffstats
path: root/crates/client/src/atuin_history/stats.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/client/src/atuin_history/stats.rs')
-rw-r--r--crates/client/src/atuin_history/stats.rs28
1 files changed, 3 insertions, 25 deletions
diff --git a/crates/client/src/atuin_history/stats.rs b/crates/client/src/atuin_history/stats.rs
index c53dafb2..462fe077 100644
--- a/crates/client/src/atuin_history/stats.rs
+++ b/crates/client/src/atuin_history/stats.rs
@@ -2,9 +2,10 @@ use std::collections::{HashMap, HashSet};
use crossterm::style::{Color, ResetColor, SetAttribute, SetForegroundColor};
use serde::{Deserialize, Serialize};
+use turtle_daemon::aclient::history::History;
use unicode_segmentation::UnicodeSegmentation;
-use crate::atuin_client::{history::History, settings::Settings};
+use crate::atuin_client::settings::Settings;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct Stats {
@@ -278,9 +279,9 @@ pub(crate) fn compute(
#[cfg(test)]
mod tests {
- use crate::atuin_client::history::History;
use crate::atuin_client::settings::Settings;
use time::OffsetDateTime;
+ use turtle_daemon::aclient::history::History;
use super::compute;
use super::{interesting_command, split_at_pipe, strip_leading_env_vars};
@@ -301,29 +302,6 @@ mod tests {
}
#[test]
- fn ignored_commands() {
- let mut settings = Settings::new().unwrap();
- settings.stats.ignored_commands.push("cd".to_string());
-
- let history = [
- History::import()
- .timestamp(OffsetDateTime::now_utc())
- .command("cd foo")
- .build()
- .into(),
- History::import()
- .timestamp(OffsetDateTime::now_utc())
- .command("cargo build stuff")
- .build()
- .into(),
- ];
-
- let stats = compute(&settings, &history, 10, 1).expect("failed to compute stats");
- assert_eq!(stats.total_commands, 1);
- assert_eq!(stats.unique_commands, 1);
- }
-
- #[test]
fn interesting_commands() {
let settings = Settings::new().unwrap();