9
9
// except according to those terms.
10
10
11
11
// ignore-windows TempDir may cause IoError on windows: #10462
12
- #![ feature( path, os, io) ]
13
-
14
- #![ feature( path, os, io) ]
12
+ #![ feature( path, env, io) ]
15
13
16
14
extern crate glob;
17
15
18
16
use glob:: glob;
19
- use std:: os ;
17
+ use std:: env ;
20
18
use std:: old_io;
21
19
use std:: old_io:: TempDir ;
22
20
@@ -42,7 +40,7 @@ fn main() {
42
40
43
41
let root = TempDir :: new ( "glob-tests" ) ;
44
42
let root = root. ok ( ) . expect ( "Should have created a temp directory" ) ;
45
- assert ! ( os :: change_dir ( root. path( ) ) . is_ok( ) ) ;
43
+ assert ! ( env :: set_current_dir ( root. path( ) ) . is_ok( ) ) ;
46
44
47
45
mk_file ( "aaa" , true ) ;
48
46
mk_file ( "aaa/apple" , true ) ;
@@ -55,7 +53,7 @@ fn main() {
55
53
mk_file ( "bbb/specials/!" , false ) ;
56
54
57
55
// windows does not allow `*` or `?` characters to exist in filenames
58
- if os :: consts:: FAMILY != "windows" {
56
+ if env :: consts:: FAMILY != "windows" {
59
57
mk_file ( "bbb/specials/*" , false ) ;
60
58
mk_file ( "bbb/specials/?" , false ) ;
61
59
}
@@ -156,7 +154,7 @@ fn main() {
156
154
assert_eq ! ( glob_vec( "aaa/apple/nope" ) , Vec :: new( ) ) ;
157
155
158
156
// windows should support both / and \ as directory separators
159
- if os :: consts:: FAMILY == "windows" {
157
+ if env :: consts:: FAMILY == "windows" {
160
158
assert_eq ! ( glob_vec( "aaa\\ apple" ) , vec!( Path :: new( "aaa/apple" ) ) ) ;
161
159
}
162
160
@@ -228,12 +226,12 @@ fn main() {
228
226
assert_eq ! ( glob_vec( "bbb/specials/!" ) , vec!( Path :: new( "bbb/specials/!" ) ) ) ;
229
227
assert_eq ! ( glob_vec( "bbb/specials/[]]" ) , vec!( Path :: new( "bbb/specials/]" ) ) ) ;
230
228
231
- if os :: consts:: FAMILY != "windows" {
229
+ if env :: consts:: FAMILY != "windows" {
232
230
assert_eq ! ( glob_vec( "bbb/specials/[*]" ) , vec!( Path :: new( "bbb/specials/*" ) ) ) ;
233
231
assert_eq ! ( glob_vec( "bbb/specials/[?]" ) , vec!( Path :: new( "bbb/specials/?" ) ) ) ;
234
232
}
235
233
236
- if os :: consts:: FAMILY == "windows" {
234
+ if env :: consts:: FAMILY == "windows" {
237
235
238
236
assert_eq ! ( glob_vec( "bbb/specials/[![]" ) , vec!(
239
237
Path :: new( "bbb/specials/!" ) ,
0 commit comments