@@ -75,7 +75,7 @@ impl Icons {
7575#[ cfg( test) ]
7676mod test {
7777 use super :: { IconTheme , Icons } ;
78- use crate :: flags:: { IconOption , IconTheme as FlagTheme , PermissionFlag } ;
78+ use crate :: flags:: { Flags , IconOption , IconTheme as FlagTheme } ;
7979 use crate :: meta:: Meta ;
8080 use std:: fs:: File ;
8181 use tempfile:: tempdir;
@@ -85,7 +85,8 @@ mod test {
8585 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
8686 let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
8787 File :: create ( & file_path) . expect ( "failed to create file" ) ;
88- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
88+ let flags = Flags :: default ( ) ;
89+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
8990
9091 let icons = Icons :: new ( true , IconOption :: Never , FlagTheme :: Fancy , " " . to_string ( ) ) ;
9192 let icon = icons. get ( & meta. name ) ;
@@ -97,7 +98,8 @@ mod test {
9798 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
9899 let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
99100 File :: create ( & file_path) . expect ( "failed to create file" ) ;
100- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
101+ let flags = Flags :: default ( ) ;
102+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
101103
102104 let icons = Icons :: new ( false , IconOption :: Never , FlagTheme :: Fancy , " " . to_string ( ) ) ;
103105 let icon = icons. get ( & meta. name ) ;
@@ -110,7 +112,8 @@ mod test {
110112 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
111113 let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
112114 File :: create ( & file_path) . expect ( "failed to create file" ) ;
113- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
115+ let flags = Flags :: default ( ) ;
116+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
114117
115118 let icons = Icons :: new ( false , IconOption :: Auto , FlagTheme :: Fancy , " " . to_string ( ) ) ;
116119 let icon = icons. get ( & meta. name ) ;
@@ -122,7 +125,8 @@ mod test {
122125 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
123126 let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
124127 File :: create ( & file_path) . expect ( "failed to create file" ) ;
125- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
128+ let flags = Flags :: default ( ) ;
129+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
126130
127131 let icons = Icons :: new ( true , IconOption :: Auto , FlagTheme :: Fancy , " " . to_string ( ) ) ;
128132 let icon = icons. get ( & meta. name ) ;
@@ -135,7 +139,8 @@ mod test {
135139 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
136140 let file_path = tmp_dir. path ( ) . join ( "file" ) ;
137141 File :: create ( & file_path) . expect ( "failed to create file" ) ;
138- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
142+ let flags = Flags :: default ( ) ;
143+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
139144
140145 let icon = Icons :: new ( true , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
141146 let icon_str = icon. get ( & meta. name ) ;
@@ -148,7 +153,8 @@ mod test {
148153 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
149154 let file_path = tmp_dir. path ( ) . join ( "file" ) ;
150155 File :: create ( & file_path) . expect ( "failed to create file" ) ;
151- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
156+ let flags = Flags :: default ( ) ;
157+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
152158
153159 let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
154160 let icon_str = icon. get ( & meta. name ) ;
@@ -161,7 +167,8 @@ mod test {
161167 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
162168 let file_path = tmp_dir. path ( ) . join ( "file" ) ;
163169 File :: create ( & file_path) . expect ( "failed to create file" ) ;
164- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
170+ let flags = Flags :: default ( ) ;
171+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
165172
166173 let icon = Icons :: new (
167174 false ,
@@ -178,7 +185,8 @@ mod test {
178185 fn get_icon_default_directory ( ) {
179186 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
180187 let file_path = tmp_dir. path ( ) ;
181- let meta = Meta :: from_path ( file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
188+ let flags = Flags :: default ( ) ;
189+ let meta = Meta :: from_path ( file_path, false , & flags) . unwrap ( ) ;
182190
183191 let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
184192 let icon_str = icon. get ( & meta. name ) ;
@@ -190,7 +198,8 @@ mod test {
190198 fn get_icon_default_directory_unicode ( ) {
191199 let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
192200 let file_path = tmp_dir. path ( ) ;
193- let meta = Meta :: from_path ( file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
201+ let flags = Flags :: default ( ) ;
202+ let meta = Meta :: from_path ( file_path, false , & flags) . unwrap ( ) ;
194203
195204 let icon = Icons :: new (
196205 false ,
@@ -210,7 +219,8 @@ mod test {
210219 for ( file_name, file_icon) in & IconTheme :: get_default_icons_by_name ( ) {
211220 let file_path = tmp_dir. path ( ) . join ( file_name) ;
212221 File :: create ( & file_path) . expect ( "failed to create file" ) ;
213- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
222+ let flags = Flags :: default ( ) ;
223+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
214224
215225 let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
216226 let icon_str = icon. get ( & meta. name ) ;
@@ -226,7 +236,8 @@ mod test {
226236 for ( ext, file_icon) in & IconTheme :: get_default_icons_by_extension ( ) {
227237 let file_path = tmp_dir. path ( ) . join ( format ! ( "file.{ext}" ) ) ;
228238 File :: create ( & file_path) . expect ( "failed to create file" ) ;
229- let meta = Meta :: from_path ( & file_path, false , PermissionFlag :: Rwx ) . unwrap ( ) ;
239+ let flags = Flags :: default ( ) ;
240+ let meta = Meta :: from_path ( & file_path, false , & flags) . unwrap ( ) ;
230241
231242 let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
232243 let icon_str = icon. get ( & meta. name ) ;
0 commit comments