Fix tests
Tested with cargo test --all-features Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
This commit is contained in:
parent
29ec08cd36
commit
a76f7f8685
2 changed files with 13 additions and 6 deletions
|
|
@ -6386,6 +6386,7 @@ pub(crate) mod test_utils {
|
||||||
location,
|
location,
|
||||||
TabConfig::default(),
|
TabConfig::default(),
|
||||||
ThumbCfg::default(),
|
ThumbCfg::default(),
|
||||||
|
None,
|
||||||
widget::Id::unique(),
|
widget::Id::unique(),
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
18
src/tab.rs
18
src/tab.rs
|
|
@ -6101,7 +6101,7 @@ fn text_editor_class(
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::{fs, io, path::PathBuf};
|
use std::{fs, io, path::PathBuf};
|
||||||
|
|
||||||
use cosmic::{iced::mouse::ScrollDelta, iced_runtime::keyboard::Modifiers};
|
use cosmic::{iced::mouse::ScrollDelta, iced_runtime::keyboard::Modifiers, widget};
|
||||||
use log::{debug, trace};
|
use log::{debug, trace};
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use test_log::test;
|
use test_log::test;
|
||||||
|
|
@ -6112,7 +6112,7 @@ mod tests {
|
||||||
assert_eq_tab_path, empty_fs, eq_path_item, filter_dirs, read_dir_sorted, simple_fs,
|
assert_eq_tab_path, empty_fs, eq_path_item, filter_dirs, read_dir_sorted, simple_fs,
|
||||||
tab_click_new, NAME_LEN, NUM_DIRS, NUM_FILES, NUM_HIDDEN, NUM_NESTED,
|
tab_click_new, NAME_LEN, NUM_DIRS, NUM_FILES, NUM_HIDDEN, NUM_NESTED,
|
||||||
},
|
},
|
||||||
config::{IconSizes, TabConfig},
|
config::{IconSizes, TabConfig, ThumbCfg},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Boilerplate for tab tests. Checks if simulated clicks selected items.
|
// Boilerplate for tab tests. Checks if simulated clicks selected items.
|
||||||
|
|
@ -6156,9 +6156,10 @@ mod tests {
|
||||||
let mut tab = Tab::new(
|
let mut tab = Tab::new(
|
||||||
Location::Path(path.into()),
|
Location::Path(path.into()),
|
||||||
TabConfig::default(),
|
TabConfig::default(),
|
||||||
None,
|
|
||||||
ThumbCfg::default(),
|
ThumbCfg::default(),
|
||||||
None,
|
None,
|
||||||
|
widget::Id::unique(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
// All directories (simple_fs only produces one nested layer)
|
// All directories (simple_fs only produces one nested layer)
|
||||||
|
|
@ -6259,9 +6260,10 @@ mod tests {
|
||||||
let mut tab = Tab::new(
|
let mut tab = Tab::new(
|
||||||
Location::Path(path.to_owned()),
|
Location::Path(path.to_owned()),
|
||||||
TabConfig::default(),
|
TabConfig::default(),
|
||||||
None,
|
|
||||||
ThumbCfg::default(),
|
ThumbCfg::default(),
|
||||||
None,
|
None,
|
||||||
|
widget::Id::unique(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
debug!(
|
debug!(
|
||||||
"Emitting Message::Location(Location::Path(\"{}\"))",
|
"Emitting Message::Location(Location::Path(\"{}\"))",
|
||||||
|
|
@ -6397,9 +6399,10 @@ mod tests {
|
||||||
let mut tab = Tab::new(
|
let mut tab = Tab::new(
|
||||||
Location::Path(path.into()),
|
Location::Path(path.into()),
|
||||||
TabConfig::default(),
|
TabConfig::default(),
|
||||||
None,
|
|
||||||
ThumbCfg::default(),
|
ThumbCfg::default(),
|
||||||
None,
|
None,
|
||||||
|
widget::Id::unique(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Tab's location shouldn't change if GoPrev or GoNext is triggered
|
// Tab's location shouldn't change if GoPrev or GoNext is triggered
|
||||||
|
|
@ -6425,9 +6428,10 @@ mod tests {
|
||||||
let mut tab = Tab::new(
|
let mut tab = Tab::new(
|
||||||
Location::Path(next_dir.clone()),
|
Location::Path(next_dir.clone()),
|
||||||
TabConfig::default(),
|
TabConfig::default(),
|
||||||
None,
|
|
||||||
ThumbCfg::default(),
|
ThumbCfg::default(),
|
||||||
None,
|
None,
|
||||||
|
widget::Id::unique(),
|
||||||
|
None,
|
||||||
);
|
);
|
||||||
// This will eventually yield false once root is hit
|
// This will eventually yield false once root is hit
|
||||||
while next_dir.pop() {
|
while next_dir.pop() {
|
||||||
|
|
@ -6464,7 +6468,9 @@ mod tests {
|
||||||
Tab::new(
|
Tab::new(
|
||||||
Location::Path(path.into()),
|
Location::Path(path.into()),
|
||||||
TabConfig::default(),
|
TabConfig::default(),
|
||||||
|
ThumbCfg::default(),
|
||||||
None,
|
None,
|
||||||
|
widget::Id::unique(),
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue