@@ -75,7 +75,7 @@ impl Icons {
75
75
#[ cfg( test) ]
76
76
mod test {
77
77
use super :: { IconTheme , Icons } ;
78
- use crate :: flags:: { IconOption , IconTheme as FlagTheme , PermissionFlag } ;
78
+ use crate :: flags:: { Flags , IconOption , IconTheme as FlagTheme } ;
79
79
use crate :: meta:: Meta ;
80
80
use std:: fs:: File ;
81
81
use tempfile:: tempdir;
@@ -85,7 +85,8 @@ mod test {
85
85
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
86
86
let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
87
87
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 ( ) ;
89
90
90
91
let icons = Icons :: new ( true , IconOption :: Never , FlagTheme :: Fancy , " " . to_string ( ) ) ;
91
92
let icon = icons. get ( & meta. name ) ;
@@ -97,7 +98,8 @@ mod test {
97
98
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
98
99
let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
99
100
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 ( ) ;
101
103
102
104
let icons = Icons :: new ( false , IconOption :: Never , FlagTheme :: Fancy , " " . to_string ( ) ) ;
103
105
let icon = icons. get ( & meta. name ) ;
@@ -110,7 +112,8 @@ mod test {
110
112
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
111
113
let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
112
114
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 ( ) ;
114
117
115
118
let icons = Icons :: new ( false , IconOption :: Auto , FlagTheme :: Fancy , " " . to_string ( ) ) ;
116
119
let icon = icons. get ( & meta. name ) ;
@@ -122,7 +125,8 @@ mod test {
122
125
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
123
126
let file_path = tmp_dir. path ( ) . join ( "file.txt" ) ;
124
127
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 ( ) ;
126
130
127
131
let icons = Icons :: new ( true , IconOption :: Auto , FlagTheme :: Fancy , " " . to_string ( ) ) ;
128
132
let icon = icons. get ( & meta. name ) ;
@@ -135,7 +139,8 @@ mod test {
135
139
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
136
140
let file_path = tmp_dir. path ( ) . join ( "file" ) ;
137
141
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 ( ) ;
139
144
140
145
let icon = Icons :: new ( true , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
141
146
let icon_str = icon. get ( & meta. name ) ;
@@ -148,7 +153,8 @@ mod test {
148
153
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
149
154
let file_path = tmp_dir. path ( ) . join ( "file" ) ;
150
155
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 ( ) ;
152
158
153
159
let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
154
160
let icon_str = icon. get ( & meta. name ) ;
@@ -161,7 +167,8 @@ mod test {
161
167
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
162
168
let file_path = tmp_dir. path ( ) . join ( "file" ) ;
163
169
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 ( ) ;
165
172
166
173
let icon = Icons :: new (
167
174
false ,
@@ -178,7 +185,8 @@ mod test {
178
185
fn get_icon_default_directory ( ) {
179
186
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
180
187
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 ( ) ;
182
190
183
191
let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
184
192
let icon_str = icon. get ( & meta. name ) ;
@@ -190,7 +198,8 @@ mod test {
190
198
fn get_icon_default_directory_unicode ( ) {
191
199
let tmp_dir = tempdir ( ) . expect ( "failed to create temp dir" ) ;
192
200
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 ( ) ;
194
203
195
204
let icon = Icons :: new (
196
205
false ,
@@ -210,7 +219,8 @@ mod test {
210
219
for ( file_name, file_icon) in & IconTheme :: get_default_icons_by_name ( ) {
211
220
let file_path = tmp_dir. path ( ) . join ( file_name) ;
212
221
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 ( ) ;
214
224
215
225
let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
216
226
let icon_str = icon. get ( & meta. name ) ;
@@ -226,7 +236,8 @@ mod test {
226
236
for ( ext, file_icon) in & IconTheme :: get_default_icons_by_extension ( ) {
227
237
let file_path = tmp_dir. path ( ) . join ( format ! ( "file.{ext}" ) ) ;
228
238
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 ( ) ;
230
241
231
242
let icon = Icons :: new ( false , IconOption :: Always , FlagTheme :: Fancy , " " . to_string ( ) ) ;
232
243
let icon_str = icon. get ( & meta. name ) ;
0 commit comments