File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ mod test {
7777 use super :: { IconTheme , Icons } ;
7878 use crate :: flags:: { IconOption , IconTheme as FlagTheme } ;
7979 use crate :: meta:: Meta ;
80- use std:: fs:: File ;
80+ use std:: fs:: { create_dir_all , File } ;
8181 use tempfile:: tempdir;
8282
8383 #[ test]
@@ -234,4 +234,23 @@ mod test {
234234 assert_eq ! ( icon_str, format!( "{}{}" , file_icon, icon. icon_separator) ) ;
235235 }
236236 }
237+
238+ #[ test]
239+ fn directory_icon_consistency ( ) {
240+ let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
241+
242+ for ( ext, _) in & IconTheme :: get_default_icons_by_extension ( ) {
243+ let dir_path = tmp_dir. path ( ) . join ( format ! ( "folder.{ext}" ) ) ;
244+ create_dir_all ( & dir_path) . expect ( "failed to create file" ) ;
245+ let meta = Meta :: from_path ( & dir_path, false , false ) . unwrap ( ) ;
246+
247+ let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
248+ let icon_str = icon. get ( & meta. name ) ;
249+
250+ assert_eq ! (
251+ icon_str,
252+ format!( "{}{}" , "\u{f115} " /* */ , icon. icon_separator)
253+ ) ;
254+ }
255+ }
237256}
You can’t perform that action at this time.
0 commit comments