Skip to content

Commit

Permalink
fix: custom icon entries are not merged with default config
Browse files Browse the repository at this point in the history
  • Loading branch information
sudame committed Jan 14, 2023
1 parent 181c990 commit 74be6d0
Show file tree
Hide file tree
Showing 2 changed files with 586 additions and 498 deletions.
7 changes: 4 additions & 3 deletions src/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ impl Icons {

#[cfg(test)]
mod test {
use super::{IconTheme, Icons};
use super::Icons;
use crate::flags::{IconOption, IconTheme as FlagTheme};
use crate::meta::Meta;
use crate::theme::icon::ByFilename;
use std::fs::File;
use tempfile::tempdir;

Expand Down Expand Up @@ -207,7 +208,7 @@ mod test {
fn get_icon_by_name() {
let tmp_dir = tempdir().expect("failed to create temp dir");

for (file_name, file_icon) in &IconTheme::get_default_icons_by_name() {
for (file_name, file_icon) in ByFilename::default_name() {
let file_path = tmp_dir.path().join(file_name);
File::create(&file_path).expect("failed to create file");
let meta = Meta::from_path(&file_path, false).unwrap();
Expand All @@ -223,7 +224,7 @@ mod test {
fn get_icon_by_extension() {
let tmp_dir = tempdir().expect("failed to create temp dir");

for (ext, file_icon) in &IconTheme::get_default_icons_by_extension() {
for (ext, file_icon) in ByFilename::default_extension() {
let file_path = tmp_dir.path().join(format!("file.{}", ext));
File::create(&file_path).expect("failed to create file");
let meta = Meta::from_path(&file_path, false).unwrap();
Expand Down
Loading

0 comments on commit 74be6d0

Please sign in to comment.