diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3dfcbb..d64bd66 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,11 +8,6 @@ repos: entry: cargo fmt --all -- language: system types: [rust] - - id: cargo-test - name: cargo test - entry: cargo test - language: system - pass_filenames: false - id: clippy name: clippy entry: | diff --git a/Cargo.lock b/Cargo.lock index 34976df..e5c5260 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -191,10 +191,8 @@ dependencies = [ "crossterm", "dirs", "futures", - "insta", "libdbus-sys", "ratatui", - "rstest", "serde", "tokio", "toml", @@ -325,17 +323,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "console" -version = "0.16.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96a4956774c13c126a8b5af4daa79384f4d826534c95a02d76afb39e2ab64e3" -dependencies = [ - "encode_unicode", - "libc", - "windows-sys", -] - [[package]] name = "convert_case" version = "0.10.0" @@ -629,12 +616,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - [[package]] name = "equivalent" version = "1.0.2" @@ -690,12 +671,6 @@ dependencies = [ "regex", ] -[[package]] -name = "fastrand" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" - [[package]] name = "filedescriptor" version = "0.8.3" @@ -808,12 +783,6 @@ version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" -[[package]] -name = "futures-timer" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" - [[package]] name = "futures-util" version = "0.3.34" @@ -864,12 +833,6 @@ dependencies = [ "r-efi 6.0.0", ] -[[package]] -name = "glob" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" - [[package]] name = "hashbrown" version = "0.16.1" @@ -929,18 +892,6 @@ dependencies = [ "rustversion", ] -[[package]] -name = "insta" -version = "1.49.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67d3d2e287e4b86c10b3f3b641033d1f89b74bdb39d05f34952e2b9a6fe21cd" -dependencies = [ - "console", - "once_cell", - "similar", - "tempfile", -] - [[package]] name = "instability" version = "0.3.14" @@ -1437,15 +1388,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" -[[package]] -name = "proc-macro-crate" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" -dependencies = [ - "toml_edit", -] - [[package]] name = "proc-macro2" version = "1.0.107" @@ -1640,41 +1582,6 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" -[[package]] -name = "relative-path" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" - -[[package]] -name = "rstest" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "948203e6d13b83e51a90d7cf236dd58a0065f23f4b902f00f306e7eb2bd09b9c" -dependencies = [ - "futures-timer", - "futures-util", - "rstest_macros", -] - -[[package]] -name = "rstest_macros" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d92eaf7b6e51e12471d71ddc72608e7151573de44099aacfbb1128177c0da4" -dependencies = [ - "cfg-if", - "glob", - "proc-macro-crate", - "proc-macro2", - "quote", - "regex", - "relative-path", - "rustc_version", - "syn 2.0.119", - "unicode-ident", -] - [[package]] name = "rustc_version" version = "0.4.1" @@ -1821,12 +1728,6 @@ dependencies = [ "libc", ] -[[package]] -name = "similar" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" - [[package]] name = "siphasher" version = "1.0.4" @@ -1954,19 +1855,6 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "tempfile" -version = "3.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom 0.4.3", - "once_cell", - "rustix", - "windows-sys", -] - [[package]] name = "termina" version = "0.3.3" @@ -2165,18 +2053,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "toml_edit" -version = "0.25.15+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1340ea94a5856333492c9064b02c778b191dd2c853778d9609debdcdfea3a614" -dependencies = [ - "indexmap", - "toml_datetime", - "toml_parser", - "winnow", -] - [[package]] name = "toml_parser" version = "1.1.3+spec-1.1.0" @@ -2451,9 +2327,6 @@ name = "winnow" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" -dependencies = [ - "memchr", -] [[package]] name = "wit-bindgen" diff --git a/Cargo.toml b/Cargo.toml index 25e0310..ed18a62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,15 +21,11 @@ tokio = { version = "1", features = ["macros", "rt"] } dirs = "7" toml = "1.1" serde = { version = "1", features = ["derive"] } -clap = { version = "4", features = ["derive"] } +clap = { version = "4", features = ["derive", "cargo"] } tui-input = "0.15" anyhow = "1" libdbus-sys = { version = "0.2", features = ["vendored"] } -[dev-dependencies] -insta = "1" -rstest = "0.27" - [profile.release] strip = true codegen-units = 1 diff --git a/Readme.md b/Readme.md index 443aaad..a6f0d05 100644 --- a/Readme.md +++ b/Readme.md @@ -65,11 +65,24 @@ This will produce an executable file at `target/release/bluetui` that you can co $ bluetui ``` +You can run `impala` with options: + +``` +$ bluetui --help +Options: + -c, --config config file path. Default ~/.config/bluetui/config.toml + --ascii Ascii display + -h, --help Print help + -V, --version Print version +``` + ## Config Keybindings can be customized in the default config file location `$HOME/.config/bluetui/config.toml` or from a custom path with `-c` ```toml +ascii = false # ascii display (false = do not show icons) + # Possible values: "Legacy", "Start", "End", "Center", "SpaceAround", "SpaceBetween" layout = "SpaceAround" diff --git a/src/app.rs b/src/app.rs index c2d705d..5f21c53 100644 --- a/src/app.rs +++ b/src/app.rs @@ -37,8 +37,6 @@ use std::sync::{Arc, atomic::Ordering}; pub type AppResult = anyhow::Result; -const STAR_SYMBOL: &str = "★"; - #[derive(Debug, Clone, Copy, PartialEq)] pub enum FocusedBlock { Adapter, @@ -284,45 +282,107 @@ impl App { .map(|d| { Row::new(vec![ if d.is_favorite { - STAR_SYMBOL.to_string() + if self.config.ascii { + "*".to_string() + } else { + " ".to_string() + } } else { String::new() }, - format!("{} {}", &d.icon, &d.alias), - d.is_trusted.to_string(), - d.is_connected.to_string(), + { + if self.config.ascii { + d.alias.clone() + } else { + format!("{} {}", d.icon, d.alias) + } + }, + { + if d.is_trusted { + "Yes".to_string() + } else { + "No".to_string() + } + }, + { + if d.is_connected { + "Yes".to_string() + } else { + "No".to_string() + } + }, { if let Some(battery_percentage) = d.battery_percentage { match battery_percentage { n if n >= 90 => { - format!("{battery_percentage}% 󰥈 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰥈 ") + } } n if (80..90).contains(&n) => { - format!("{battery_percentage}% 󰥅 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰥅 ") + } } n if (70..80).contains(&n) => { - format!("{battery_percentage}% 󰥄 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰥄 ") + } } n if (60..70).contains(&n) => { - format!("{battery_percentage}% 󰥃 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰥃 ") + } } n if (50..60).contains(&n) => { - format!("{battery_percentage}% 󰥂 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰥂 ") + } } n if (40..50).contains(&n) => { - format!("{battery_percentage}% 󰥁 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰥁 ") + } } n if (30..40).contains(&n) => { - format!("{battery_percentage}% 󰥀 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰥀 ") + } } n if (20..30).contains(&n) => { - format!("{battery_percentage}% 󰤿 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰤿 ") + } } n if (10..20).contains(&n) => { - format!("{battery_percentage}% 󰤾 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰤾 ") + } } _ => { - format!("{battery_percentage}% 󰤾 ") + if self.config.ascii { + format!("{battery_percentage}%") + } else { + format!("{battery_percentage}% 󰤾 ") + } } } } else { @@ -440,10 +500,13 @@ impl App { .new_devices .iter() .map(|d| { - Row::new(vec![ - d.addr.to_string(), - format!("{} {}", &d.icon, &d.alias), - ]) + Row::new(vec![d.addr.to_string(), { + if self.config.ascii { + d.alias.clone() + } else { + format!("{} {}", d.icon, d.alias) + } + }]) }) .collect(); let rows_len = rows.len(); @@ -470,7 +533,11 @@ impl App { Block::bordered() .padding(Padding::horizontal(1)) .title(if selected_controller.is_scanning.load(Ordering::Relaxed) { - format!(" Scanning {} ", self.spinner.draw()) + if self.config.ascii { + " Scanning ".to_string() + } else { + format!(" Scanning {} ", self.spinner.draw()) + } } else { String::from(" Discovered devices ") }) diff --git a/src/cli.rs b/src/cli.rs index d07801c..a837aac 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,9 +1,23 @@ -use clap::Parser; +use clap::{crate_description, value_parser}; use std::path::PathBuf; -#[derive(Parser)] -#[command(version, about)] -pub struct Args { - #[arg(short, long)] - pub config_path: Option, +use clap::{ArgAction, Command, arg, crate_version}; + +pub fn cli() -> Command { + Command::new("impala") + .about(crate_description!()) + .version(crate_version!()) + .arg( + arg!(--config ) + .short('c') + .required(false) + .help("config file path. Default ~/.config/bluetui/config.toml") + .value_parser(value_parser!(PathBuf)), + ) + .arg( + arg!(--ascii) + .required(false) + .help("Ascii display") + .action(ArgAction::SetTrue), + ) } diff --git a/src/config.rs b/src/config.rs index fd6f525..be3a948 100644 --- a/src/config.rs +++ b/src/config.rs @@ -12,6 +12,9 @@ use serde::{ #[derive(Deserialize, Debug)] pub struct Config { + #[serde(default = "default_ascii")] + pub ascii: bool, + #[serde(default = "default_layout", deserialize_with = "deserialize_layout")] pub layout: Flex, @@ -31,6 +34,10 @@ pub struct Config { pub paired_device: PairedDevice, } +fn default_ascii() -> bool { + false +} + #[derive(Debug, Default)] pub enum Width { #[default] @@ -202,13 +209,15 @@ fn default_toggle_device_favorite() -> char { } impl Config { - pub fn new(config_file_path: Option) -> Self { - let conf_path = config_file_path.unwrap_or( + pub fn new(config_file_path: Option<&PathBuf>) -> Self { + let conf_path = if let Some(path) = config_file_path { + path.to_owned() + } else { dirs::config_dir() .unwrap() .join("bluetui") - .join("config.toml"), - ); + .join("config.toml") + }; let config = std::fs::read_to_string(conf_path).unwrap_or_default(); let app_config: Config = match toml::from_str(&config) { diff --git a/src/help.rs b/src/help.rs index a536bae..dbdc20b 100644 --- a/src/help.rs +++ b/src/help.rs @@ -20,14 +20,23 @@ impl Help { rendering_block: Rect, config: Arc, ) { + let enter_space = Span::from(if config.ascii { + "Space/Enter" + } else { + "󱁐 or ↵ " + }) + .bold(); + let enter = Span::from(if config.ascii { "Enter" } else { " ↵ " }).bold(); + let tab = Span::from(if config.ascii { "Tab" } else { "⇄" }).bold(); + let esc = Span::from(if config.ascii { "Tab" } else { "󱊷 " }).bold(); let help = match focused_block { FocusedBlock::PairedDevices => { - if area.width > 120 { + if area.width > 124 { vec![Line::from(vec![ - Span::from("k,").bold(), + Span::from("k,↑").bold(), Span::from(" Up"), Span::from(" | "), - Span::from("j,").bold(), + Span::from("j,↓").bold(), Span::from(" Down"), Span::from(" | "), Span::from("s").bold(), @@ -36,7 +45,7 @@ impl Help { Span::from(config.paired_device.unpair.to_string()).bold(), Span::from(" Unpair"), Span::from(" | "), - Span::from("󱁐 or ↵ ").bold(), + enter_space, Span::from(" Dis/Connect"), Span::from(" | "), Span::from(config.paired_device.toggle_trust.to_string()).bold(), @@ -48,13 +57,13 @@ impl Help { Span::from(config.paired_device.rename.to_string()).bold(), Span::from(" Rename"), Span::from(" | "), - Span::from("⇄").bold(), + tab, Span::from(" Nav"), ])] } else { vec![ Line::from(vec![ - Span::from("󱁐 or ↵ ").bold(), + enter_space, Span::from(" Dis/Connect"), Span::from(" | "), Span::from("s").bold(), @@ -73,36 +82,36 @@ impl Help { Span::from(config.paired_device.rename.to_string()).bold(), Span::from(" Rename"), Span::from(" | "), - Span::from("k,").bold(), + Span::from("k,↑").bold(), Span::from(" Up"), Span::from(" | "), - Span::from("j,").bold(), + Span::from("j,↓").bold(), Span::from(" Down"), Span::from(" | "), - Span::from("⇄").bold(), + tab, Span::from(" Nav"), ]), ] } } FocusedBlock::NewDevices => vec![Line::from(vec![ - Span::from("k,").bold(), + Span::from("k,↑").bold(), Span::from(" Up"), Span::from(" | "), - Span::from("j,").bold(), + Span::from("j,↓").bold(), Span::from(" Down"), Span::from(" | "), - Span::from("󱁐 or ↵ ").bold(), + enter_space, Span::from(" Pair"), Span::from(" | "), Span::from("s").bold(), Span::from(" Scan on/off"), Span::from(" | "), - Span::from("⇄").bold(), + tab, Span::from(" Nav"), ])], FocusedBlock::Adapter => { - if area.width > 80 { + if area.width > 81 { vec![Line::from(vec![ Span::from("s").bold(), Span::from(" Scan on/off"), @@ -116,7 +125,7 @@ impl Help { Span::from(config.adapter.toggle_discovery.to_string()).bold(), Span::from(" Discovery on/off"), Span::from(" | "), - Span::from("⇄").bold(), + tab, Span::from(" Nav"), ])] } else { @@ -135,7 +144,7 @@ impl Help { Span::from(config.adapter.toggle_discovery.to_string()).bold(), Span::from(" Discovery on/off"), Span::from(" | "), - Span::from("⇄").bold(), + tab, Span::from(" Nav"), ]), ] @@ -143,92 +152,51 @@ impl Help { } FocusedBlock::SetDeviceAliasBox => { vec![Line::from(vec![ - Span::from("󱊷 ").bold(), + esc, Span::from(" Discard"), Span::from(" | "), - Span::from("↵ ").bold(), + enter, Span::from(" Apply"), ])] } FocusedBlock::RequestConfirmation | FocusedBlock::UnpairConfirmation { .. } => { vec![Line::from(vec![ - Span::from("↵ ").bold(), + enter, Span::from(" Ok"), Span::from(" | "), - Span::from("󱊷 ").bold(), + esc, Span::from(" Discard"), Span::from(" | "), - Span::from("⇄").bold(), + tab, Span::from(" Nav"), ])] } FocusedBlock::EnterPinCode | FocusedBlock::EnterPasskey => { vec![Line::from(vec![ - Span::from("󱊷 ").bold(), + esc, Span::from(" Discard"), Span::from(" | "), - Span::from("⇄").bold(), + tab, Span::from(" Nav"), Span::from(" | "), - Span::from("↵ ").bold(), + enter, Span::from(" Submit"), ])] } FocusedBlock::DisplayPinCode => { vec![Line::from(vec![ - Span::from(" 󱊷 or ↵ ").bold(), + esc, + Span::from(" Discard"), + Span::from(" | "), + enter, Span::from(" Ok"), ])] } FocusedBlock::DisplayPasskey => { - vec![Line::from(vec![ - Span::from(" 󱊷 ").bold(), - Span::from(" Discard"), - ])] + vec![Line::from(vec![esc, Span::from(" Discard")])] } }; let help = Paragraph::new(help).centered().blue(); frame.render_widget(help, rendering_block); } } - -#[cfg(test)] -mod tests { - use super::*; - use insta::assert_snapshot; - use ratatui::{Terminal, backend::TestBackend}; - use rstest::rstest; - - #[rstest] - fn render_help( - #[values( - FocusedBlock::Adapter, - FocusedBlock::PairedDevices, - FocusedBlock::NewDevices, - FocusedBlock::SetDeviceAliasBox, - FocusedBlock::RequestConfirmation, - FocusedBlock::EnterPinCode, - FocusedBlock::EnterPasskey, - FocusedBlock::DisplayPinCode, - FocusedBlock::DisplayPasskey - )] - focused_block: FocusedBlock, - #[values(80, 81, 120, 121)] width: u16, - ) { - let mut terminal = Terminal::new(TestBackend::new(width, 2)).unwrap(); - terminal - .draw(|frame| { - Help::render( - frame, - frame.area(), - focused_block, - frame.area(), - Config::new(None).into(), - ); - }) - .unwrap(); - - let snapshot_name = format!("{:?}-{}", focused_block, width); - assert_snapshot!(snapshot_name, terminal.backend()); - } -} diff --git a/src/main.rs b/src/main.rs index 2ed7aee..a697b29 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,26 +7,20 @@ use bluetui::{ rfkill, tui::Tui, }; -use clap::Parser; use ratatui::{Terminal, backend::CrosstermBackend}; -use std::{io, process::exit, sync::Arc}; +use std::{io, path::PathBuf, sync::Arc}; #[tokio::main(flavor = "current_thread")] async fn main() -> AppResult<()> { - let args = cli::Args::parse(); - - let config_file_path = args.config_path.map(|config_path| { - if config_path.exists() { - config_path.clone() - } else { - eprintln!("Config file not found"); - exit(1); - } - }); + let args = cli::cli().get_matches(); rfkill::check()?; - let config = Arc::new(Config::new(config_file_path)); + let custom_config_file = args.get_one::("config"); + + let mut config = Config::new(custom_config_file); + config.ascii = args.get_flag("ascii"); + let config = Arc::new(config); let backend = CrosstermBackend::new(io::stdout()); let terminal = Terminal::new(backend)?; diff --git a/src/notification.rs b/src/notification.rs index b84535f..865d0f0 100644 --- a/src/notification.rs +++ b/src/notification.rs @@ -94,52 +94,3 @@ pub fn notification_rect(offset: u16, height: u16, width: u16, r: Rect) -> Rect ) .split(popup_layout[1])[1] } - -#[cfg(test)] -mod tests { - use super::*; - use insta::assert_snapshot; - use ratatui::{Terminal, backend::TestBackend}; - use rstest::rstest; - use std::hash::{DefaultHasher, Hash, Hasher}; - - #[rstest] - fn render_good( - #[values( - "short", - "with\nnewline", - "extremely long WITHOUT newline Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id mauris sit amet libero convallis fringilla quis non augue. In sollicitudin quam sed magna finibus, vitae malesuada magna porttitor. Pellentesque in dictum dui. Nullam nec mi venenatis, faucibus odio eget, molestie nisi. Fusce velit nibh, euismod vel lectus id, placerat.", - r"extremely long WITH newline Lorem ipsum dolor sit amet, consectetur -adipiscing elit. Sed id mauris sit amet libero convallis fringilla quis non -augue. In sollicitudin quam sed magna finibus, vitae malesuada magna porttitor. -Pellentesque in dictum dui. Nullam nec mi venenatis, faucibus odio eget, molestie -nisi. Fusce velit nibh, euismod vel lectus id, placerat." - )] - message_str: &'static str, - #[values( - NotificationLevel::Info, - NotificationLevel::Warning, - NotificationLevel::Error - )] - level: NotificationLevel, - ) { - let mut terminal = Terminal::new(TestBackend::new(80, 24)).unwrap(); - terminal - .draw(|frame| { - let notification = Notification { - message: message_str.into(), - level: level.clone(), - ttl: 1, - }; - notification.render(0, frame, frame.area()); - }) - .unwrap(); - - let mut hasher = DefaultHasher::new(); - message_str.hash(&mut hasher); - let hash = hasher.finish(); - - let snapshot_name = format!("{}-{:?}", hash, level); - assert_snapshot!(snapshot_name, terminal.backend()); - } -} diff --git a/src/requests/confirmation.rs b/src/requests/confirmation.rs index b1fd4e0..d1dc715 100644 --- a/src/requests/confirmation.rs +++ b/src/requests/confirmation.rs @@ -129,33 +129,3 @@ impl Confirmation { frame.render_widget(choice.centered(), choices_block); } } - -#[cfg(test)] -mod tests { - use super::*; - use insta::assert_snapshot; - use ratatui::{Terminal, backend::TestBackend}; - use rstest::rstest; - - #[rstest] - fn render( - #[values(u32::MIN, 1, u32::MAX)] passkey: u32, - #[values(true, false)] confirmed: bool, - ) { - let mut terminal = Terminal::new(TestBackend::new(80, 24)).unwrap(); - terminal - .draw(|frame| { - let mut confirmation = - Confirmation::new("adapter".to_string(), Address::new(*b"DEADBE"), passkey); - - if !confirmed { - confirmation.toggle_select(); - } - - confirmation.render(frame, frame.area()); - }) - .unwrap(); - - assert_snapshot!(format!("{passkey}-{confirmed}"), terminal.backend()); - } -} diff --git a/src/requests/enter_pin_code.rs b/src/requests/enter_pin_code.rs index bc82a6b..4228e79 100644 --- a/src/requests/enter_pin_code.rs +++ b/src/requests/enter_pin_code.rs @@ -205,23 +205,3 @@ impl EnterPinCode { frame.render_widget(submit, submit_block); } } - -#[cfg(test)] -mod tests { - use super::*; - use insta::assert_snapshot; - use ratatui::{Terminal, backend::TestBackend}; - - #[test] - fn render() { - let mut terminal = Terminal::new(TestBackend::new(80, 10)).unwrap(); - terminal - .draw(|frame| { - EnterPinCode::new("adapter".to_string(), Address::new(*b"DEADBE")) - .render(frame, frame.area()); - }) - .unwrap(); - - assert_snapshot!(terminal.backend()); - } -} diff --git a/src/requests/snapshots/bluetui__requests__confirmation__tests__0-false.snap b/src/requests/snapshots/bluetui__requests__confirmation__tests__0-false.snap deleted file mode 100644 index e4fe147..0000000 --- a/src/requests/snapshots/bluetui__requests__confirmation__tests__0-false.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/requests/confirmation.rs -expression: terminal.backend() ---- -" " -" " -" " -" " -" " -" " -" " -" " -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Authentication required for the device 44:45:41:44:42:45 ┃ " -" ┃ ┃ " -" ┃ Confirm Passkey 000000 ┃ " -" ┃ ┃ " -" ┃ No Yes ┃ " -" ┃ ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/requests/snapshots/bluetui__requests__confirmation__tests__0-true.snap b/src/requests/snapshots/bluetui__requests__confirmation__tests__0-true.snap deleted file mode 100644 index e4fe147..0000000 --- a/src/requests/snapshots/bluetui__requests__confirmation__tests__0-true.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/requests/confirmation.rs -expression: terminal.backend() ---- -" " -" " -" " -" " -" " -" " -" " -" " -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Authentication required for the device 44:45:41:44:42:45 ┃ " -" ┃ ┃ " -" ┃ Confirm Passkey 000000 ┃ " -" ┃ ┃ " -" ┃ No Yes ┃ " -" ┃ ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/requests/snapshots/bluetui__requests__confirmation__tests__1-false.snap b/src/requests/snapshots/bluetui__requests__confirmation__tests__1-false.snap deleted file mode 100644 index 424348f..0000000 --- a/src/requests/snapshots/bluetui__requests__confirmation__tests__1-false.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/requests/confirmation.rs -expression: terminal.backend() ---- -" " -" " -" " -" " -" " -" " -" " -" " -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Authentication required for the device 44:45:41:44:42:45 ┃ " -" ┃ ┃ " -" ┃ Confirm Passkey 000001 ┃ " -" ┃ ┃ " -" ┃ No Yes ┃ " -" ┃ ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/requests/snapshots/bluetui__requests__confirmation__tests__1-true.snap b/src/requests/snapshots/bluetui__requests__confirmation__tests__1-true.snap deleted file mode 100644 index 424348f..0000000 --- a/src/requests/snapshots/bluetui__requests__confirmation__tests__1-true.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/requests/confirmation.rs -expression: terminal.backend() ---- -" " -" " -" " -" " -" " -" " -" " -" " -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Authentication required for the device 44:45:41:44:42:45 ┃ " -" ┃ ┃ " -" ┃ Confirm Passkey 000001 ┃ " -" ┃ ┃ " -" ┃ No Yes ┃ " -" ┃ ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/requests/snapshots/bluetui__requests__confirmation__tests__4294967295-false.snap b/src/requests/snapshots/bluetui__requests__confirmation__tests__4294967295-false.snap deleted file mode 100644 index 15827c2..0000000 --- a/src/requests/snapshots/bluetui__requests__confirmation__tests__4294967295-false.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/requests/confirmation.rs -expression: terminal.backend() ---- -" " -" " -" " -" " -" " -" " -" " -" " -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Authentication required for the device 44:45:41:44:42:45 ┃ " -" ┃ ┃ " -" ┃ Confirm Passkey 4294967295 ┃ " -" ┃ ┃ " -" ┃ No Yes ┃ " -" ┃ ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/requests/snapshots/bluetui__requests__confirmation__tests__4294967295-true.snap b/src/requests/snapshots/bluetui__requests__confirmation__tests__4294967295-true.snap deleted file mode 100644 index 15827c2..0000000 --- a/src/requests/snapshots/bluetui__requests__confirmation__tests__4294967295-true.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/requests/confirmation.rs -expression: terminal.backend() ---- -" " -" " -" " -" " -" " -" " -" " -" " -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Authentication required for the device 44:45:41:44:42:45 ┃ " -" ┃ ┃ " -" ┃ Confirm Passkey 4294967295 ┃ " -" ┃ ┃ " -" ┃ No Yes ┃ " -" ┃ ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/requests/snapshots/bluetui__requests__enter_pin_code__tests__render.snap b/src/requests/snapshots/bluetui__requests__enter_pin_code__tests__render.snap deleted file mode 100644 index 4f8f134..0000000 --- a/src/requests/snapshots/bluetui__requests__enter_pin_code__tests__render.snap +++ /dev/null @@ -1,14 +0,0 @@ ---- -source: src/requests/enter_pin_code.rs -expression: terminal.backend() ---- -" " -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Enter the PIN Code for the device 44:45:41:44:42:45 on adapter ┃ " -" ┃ ┃ " -" ┃ Pin Code ┃ " -" ┃ ┃ " -" ┃ ┃ " -" ┃ Submit ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " diff --git a/src/snapshots/bluetui__help__tests__Adapter-120.snap b/src/snapshots/bluetui__help__tests__Adapter-120.snap deleted file mode 100644 index d2b7b75..0000000 --- a/src/snapshots/bluetui__help__tests__Adapter-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" s Scan on/off | p Pairing on/off | o Power on/off | d Discovery on/off | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__Adapter-121.snap b/src/snapshots/bluetui__help__tests__Adapter-121.snap deleted file mode 100644 index 862ef14..0000000 --- a/src/snapshots/bluetui__help__tests__Adapter-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" s Scan on/off | p Pairing on/off | o Power on/off | d Discovery on/off | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__Adapter-80.snap b/src/snapshots/bluetui__help__tests__Adapter-80.snap deleted file mode 100644 index 4216bc5..0000000 --- a/src/snapshots/bluetui__help__tests__Adapter-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" s Scan on/off | p Pairing on/off " -" o Power on/off | d Discovery on/off | ⇄ Nav " diff --git a/src/snapshots/bluetui__help__tests__Adapter-81.snap b/src/snapshots/bluetui__help__tests__Adapter-81.snap deleted file mode 100644 index 28a1eae..0000000 --- a/src/snapshots/bluetui__help__tests__Adapter-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" s Scan on/off | p Pairing on/off | o Power on/off | d Discovery on/off | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPasskey-120.snap b/src/snapshots/bluetui__help__tests__DisplayPasskey-120.snap deleted file mode 100644 index 7c1a920..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPasskey-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPasskey-121.snap b/src/snapshots/bluetui__help__tests__DisplayPasskey-121.snap deleted file mode 100644 index 637534a..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPasskey-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPasskey-80.snap b/src/snapshots/bluetui__help__tests__DisplayPasskey-80.snap deleted file mode 100644 index 129a460..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPasskey-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPasskey-81.snap b/src/snapshots/bluetui__help__tests__DisplayPasskey-81.snap deleted file mode 100644 index fe1e9c3..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPasskey-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPinCode-120.snap b/src/snapshots/bluetui__help__tests__DisplayPinCode-120.snap deleted file mode 100644 index 9c34935..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPinCode-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 or ↵ Ok " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPinCode-121.snap b/src/snapshots/bluetui__help__tests__DisplayPinCode-121.snap deleted file mode 100644 index b2008f2..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPinCode-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 or ↵ Ok " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPinCode-80.snap b/src/snapshots/bluetui__help__tests__DisplayPinCode-80.snap deleted file mode 100644 index 0209afb..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPinCode-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 or ↵ Ok " -" " diff --git a/src/snapshots/bluetui__help__tests__DisplayPinCode-81.snap b/src/snapshots/bluetui__help__tests__DisplayPinCode-81.snap deleted file mode 100644 index 7fec9bb..0000000 --- a/src/snapshots/bluetui__help__tests__DisplayPinCode-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 or ↵ Ok " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPasskey-120.snap b/src/snapshots/bluetui__help__tests__EnterPasskey-120.snap deleted file mode 100644 index ab44c2e..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPasskey-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPasskey-121.snap b/src/snapshots/bluetui__help__tests__EnterPasskey-121.snap deleted file mode 100644 index 4cdc9ef..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPasskey-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPasskey-80.snap b/src/snapshots/bluetui__help__tests__EnterPasskey-80.snap deleted file mode 100644 index 3211c9e..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPasskey-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPasskey-81.snap b/src/snapshots/bluetui__help__tests__EnterPasskey-81.snap deleted file mode 100644 index 1dd0c52..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPasskey-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPinCode-120.snap b/src/snapshots/bluetui__help__tests__EnterPinCode-120.snap deleted file mode 100644 index ab44c2e..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPinCode-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPinCode-121.snap b/src/snapshots/bluetui__help__tests__EnterPinCode-121.snap deleted file mode 100644 index 4cdc9ef..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPinCode-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPinCode-80.snap b/src/snapshots/bluetui__help__tests__EnterPinCode-80.snap deleted file mode 100644 index 3211c9e..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPinCode-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__EnterPinCode-81.snap b/src/snapshots/bluetui__help__tests__EnterPinCode-81.snap deleted file mode 100644 index 1dd0c52..0000000 --- a/src/snapshots/bluetui__help__tests__EnterPinCode-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ⇄ Nav | ↵ Submit " -" " diff --git a/src/snapshots/bluetui__help__tests__NewDevices-120.snap b/src/snapshots/bluetui__help__tests__NewDevices-120.snap deleted file mode 100644 index 9eac78a..0000000 --- a/src/snapshots/bluetui__help__tests__NewDevices-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" k, Up | j, Down | 󱁐 or ↵ Pair | s Scan on/off | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__NewDevices-121.snap b/src/snapshots/bluetui__help__tests__NewDevices-121.snap deleted file mode 100644 index 184ba1e..0000000 --- a/src/snapshots/bluetui__help__tests__NewDevices-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" k, Up | j, Down | 󱁐 or ↵ Pair | s Scan on/off | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__NewDevices-80.snap b/src/snapshots/bluetui__help__tests__NewDevices-80.snap deleted file mode 100644 index 052672b..0000000 --- a/src/snapshots/bluetui__help__tests__NewDevices-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" k, Up | j, Down | 󱁐 or ↵ Pair | s Scan on/off | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__NewDevices-81.snap b/src/snapshots/bluetui__help__tests__NewDevices-81.snap deleted file mode 100644 index 5cff828..0000000 --- a/src/snapshots/bluetui__help__tests__NewDevices-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" k, Up | j, Down | 󱁐 or ↵ Pair | s Scan on/off | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__PairedDevices-120.snap b/src/snapshots/bluetui__help__tests__PairedDevices-120.snap deleted file mode 100644 index 18c56cd..0000000 --- a/src/snapshots/bluetui__help__tests__PairedDevices-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱁐 or ↵ Dis/Connect | s Scan on/off | u Unpair | f Un/Favorite " -" t Un/Trust | e Rename | k, Up | j, Down | ⇄ Nav " diff --git a/src/snapshots/bluetui__help__tests__PairedDevices-121.snap b/src/snapshots/bluetui__help__tests__PairedDevices-121.snap deleted file mode 100644 index b80412b..0000000 --- a/src/snapshots/bluetui__help__tests__PairedDevices-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" k, Up | j, Down | s Scan on/off | u Unpair | 󱁐 or ↵ Dis/Connect | t Un/Trust | f Un/Favorite | e Rename | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__PairedDevices-80.snap b/src/snapshots/bluetui__help__tests__PairedDevices-80.snap deleted file mode 100644 index 0936b60..0000000 --- a/src/snapshots/bluetui__help__tests__PairedDevices-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱁐 or ↵ Dis/Connect | s Scan on/off | u Unpair | f Un/Favorite " -" t Un/Trust | e Rename | k, Up | j, Down | ⇄ Nav " diff --git a/src/snapshots/bluetui__help__tests__PairedDevices-81.snap b/src/snapshots/bluetui__help__tests__PairedDevices-81.snap deleted file mode 100644 index 62d2864..0000000 --- a/src/snapshots/bluetui__help__tests__PairedDevices-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱁐 or ↵ Dis/Connect | s Scan on/off | u Unpair | f Un/Favorite " -" t Un/Trust | e Rename | k, Up | j, Down | ⇄ Nav " diff --git a/src/snapshots/bluetui__help__tests__RequestConfirmation-120.snap b/src/snapshots/bluetui__help__tests__RequestConfirmation-120.snap deleted file mode 100644 index f108863..0000000 --- a/src/snapshots/bluetui__help__tests__RequestConfirmation-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" ↵ Ok | 󱊷 Discard | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__RequestConfirmation-121.snap b/src/snapshots/bluetui__help__tests__RequestConfirmation-121.snap deleted file mode 100644 index 2626828..0000000 --- a/src/snapshots/bluetui__help__tests__RequestConfirmation-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" ↵ Ok | 󱊷 Discard | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__RequestConfirmation-80.snap b/src/snapshots/bluetui__help__tests__RequestConfirmation-80.snap deleted file mode 100644 index bfa2b0c..0000000 --- a/src/snapshots/bluetui__help__tests__RequestConfirmation-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" ↵ Ok | 󱊷 Discard | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__RequestConfirmation-81.snap b/src/snapshots/bluetui__help__tests__RequestConfirmation-81.snap deleted file mode 100644 index f160fb9..0000000 --- a/src/snapshots/bluetui__help__tests__RequestConfirmation-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" ↵ Ok | 󱊷 Discard | ⇄ Nav " -" " diff --git a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-120.snap b/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-120.snap deleted file mode 100644 index 59ab211..0000000 --- a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-120.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ↵ Apply " -" " diff --git a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-121.snap b/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-121.snap deleted file mode 100644 index 40c898e..0000000 --- a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-121.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ↵ Apply " -" " diff --git a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-80.snap b/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-80.snap deleted file mode 100644 index 2e19bbc..0000000 --- a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-80.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ↵ Apply " -" " diff --git a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-81.snap b/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-81.snap deleted file mode 100644 index 08f830d..0000000 --- a/src/snapshots/bluetui__help__tests__SetDeviceAliasBox-81.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: src/help.rs -expression: terminal.backend() ---- -" 󱊷 Discard | ↵ Apply " -" " diff --git a/src/snapshots/bluetui__notification__tests__10048321478723220837-Error.snap b/src/snapshots/bluetui__notification__tests__10048321478723220837-Error.snap deleted file mode 100644 index b81a348..0000000 --- a/src/snapshots/bluetui__notification__tests__10048321478723220837-Error.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Error ┃ " -" ┃ extremely long WITH newline Lorem ipsum dolor sit amet, consectetur ┃ " -" ┃adipiscing elit. Sed id mauris sit amet libero convallis fringilla quis non┃ " -" ┃ augue. In sollicitudin quam sed magna finibus, vitae malesuada magna ┃ " -" ┃ porttitor. ┃ " -" ┃ Pellentesque in dictum dui. Nullam nec mi venenatis, faucibus odio eget, ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__10048321478723220837-Info.snap b/src/snapshots/bluetui__notification__tests__10048321478723220837-Info.snap deleted file mode 100644 index 2b2de5f..0000000 --- a/src/snapshots/bluetui__notification__tests__10048321478723220837-Info.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Info ┃ " -" ┃ extremely long WITH newline Lorem ipsum dolor sit amet, consectetur ┃ " -" ┃adipiscing elit. Sed id mauris sit amet libero convallis fringilla quis non┃ " -" ┃ augue. In sollicitudin quam sed magna finibus, vitae malesuada magna ┃ " -" ┃ porttitor. ┃ " -" ┃ Pellentesque in dictum dui. Nullam nec mi venenatis, faucibus odio eget, ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__10048321478723220837-Warning.snap b/src/snapshots/bluetui__notification__tests__10048321478723220837-Warning.snap deleted file mode 100644 index 9379d69..0000000 --- a/src/snapshots/bluetui__notification__tests__10048321478723220837-Warning.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Warning ┃ " -" ┃ extremely long WITH newline Lorem ipsum dolor sit amet, consectetur ┃ " -" ┃adipiscing elit. Sed id mauris sit amet libero convallis fringilla quis non┃ " -" ┃ augue. In sollicitudin quam sed magna finibus, vitae malesuada magna ┃ " -" ┃ porttitor. ┃ " -" ┃ Pellentesque in dictum dui. Nullam nec mi venenatis, faucibus odio eget, ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__11353925441405961020-Error.snap b/src/snapshots/bluetui__notification__tests__11353925441405961020-Error.snap deleted file mode 100644 index 963820f..0000000 --- a/src/snapshots/bluetui__notification__tests__11353925441405961020-Error.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━┓ " -" ┃ Error ┃ " -" ┃ short ┃ " -" ┗━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__11353925441405961020-Info.snap b/src/snapshots/bluetui__notification__tests__11353925441405961020-Info.snap deleted file mode 100644 index c00304c..0000000 --- a/src/snapshots/bluetui__notification__tests__11353925441405961020-Info.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━┓ " -" ┃ Info ┃ " -" ┃ short ┃ " -" ┗━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__11353925441405961020-Warning.snap b/src/snapshots/bluetui__notification__tests__11353925441405961020-Warning.snap deleted file mode 100644 index dca8514..0000000 --- a/src/snapshots/bluetui__notification__tests__11353925441405961020-Warning.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━┓ " -" ┃ Warning ┃ " -" ┃ short ┃ " -" ┗━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__15528810436234314490-Error.snap b/src/snapshots/bluetui__notification__tests__15528810436234314490-Error.snap deleted file mode 100644 index dbd21c6..0000000 --- a/src/snapshots/bluetui__notification__tests__15528810436234314490-Error.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━┓ " -" ┃ Error ┃ " -" ┃ with ┃ " -" ┃ newline ┃ " -" ┗━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__15528810436234314490-Info.snap b/src/snapshots/bluetui__notification__tests__15528810436234314490-Info.snap deleted file mode 100644 index 9112b21..0000000 --- a/src/snapshots/bluetui__notification__tests__15528810436234314490-Info.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━┓ " -" ┃ Info ┃ " -" ┃ with ┃ " -" ┃ newline ┃ " -" ┗━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__15528810436234314490-Warning.snap b/src/snapshots/bluetui__notification__tests__15528810436234314490-Warning.snap deleted file mode 100644 index 8ecd61d..0000000 --- a/src/snapshots/bluetui__notification__tests__15528810436234314490-Warning.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━┓ " -" ┃ Warning ┃ " -" ┃ with ┃ " -" ┃ newline ┃ " -" ┗━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__16756392106269011238-Error.snap b/src/snapshots/bluetui__notification__tests__16756392106269011238-Error.snap deleted file mode 100644 index 2d1a469..0000000 --- a/src/snapshots/bluetui__notification__tests__16756392106269011238-Error.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Error ┃ " -" ┃ extremely long WITHOUT newline Lorem ipsum dolor sit amet, consectetur ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__16756392106269011238-Info.snap b/src/snapshots/bluetui__notification__tests__16756392106269011238-Info.snap deleted file mode 100644 index 903984e..0000000 --- a/src/snapshots/bluetui__notification__tests__16756392106269011238-Info.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Info ┃ " -" ┃ extremely long WITHOUT newline Lorem ipsum dolor sit amet, consectetur ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/snapshots/bluetui__notification__tests__16756392106269011238-Warning.snap b/src/snapshots/bluetui__notification__tests__16756392106269011238-Warning.snap deleted file mode 100644 index e57f06f..0000000 --- a/src/snapshots/bluetui__notification__tests__16756392106269011238-Warning.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -source: src/notification.rs -expression: terminal.backend() ---- -" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ " -" ┃ Warning ┃ " -" ┃ extremely long WITHOUT newline Lorem ipsum dolor sit amet, consectetur ┃ " -" ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " diff --git a/src/spinner.rs b/src/spinner.rs index bfaecd2..cb28314 100644 --- a/src/spinner.rs +++ b/src/spinner.rs @@ -1,4 +1,4 @@ -static SPINNER_CHARS: &[char] = &['⦾', '⦿']; +static SPINNER_CHARS: &[char] = &['󰐽', '󰐾']; #[derive(Default, Clone, Copy, Debug)] pub struct Spinner {