@@ -10,7 +10,7 @@ def setup
10
10
$VERBOSE = nil
11
11
@root = File . realpath ( Dir . mktmpdir ( '__test_dir__' ) )
12
12
@nodir = File . join ( @root , "dummy" )
13
- for i in ?a..?z
13
+ for i in "a" .. "z"
14
14
if i . ord % 2 == 0
15
15
FileUtils . touch ( File . join ( @root , i ) )
16
16
else
@@ -131,14 +131,14 @@ def test_close
131
131
end
132
132
133
133
def test_glob
134
- assert_equal ( ( %w( . .. ) + ( ?a..?z ) . to_a ) . map { |f | File . join ( @root , f ) } ,
134
+ assert_equal ( ( %w( . .. ) + ( "a" .. "z" ) . to_a ) . map { |f | File . join ( @root , f ) } ,
135
135
Dir . glob ( File . join ( @root , "*" ) , File ::FNM_DOTMATCH ) . sort )
136
- assert_equal ( [ @root ] + ( ?a..?z ) . map { |f | File . join ( @root , f ) } . sort ,
136
+ assert_equal ( [ @root ] + ( "a" .. "z" ) . map { |f | File . join ( @root , f ) } . sort ,
137
137
Dir . glob ( [ @root , File . join ( @root , "*" ) ] ) . sort )
138
- assert_equal ( [ @root ] + ( ?a..?z ) . map { |f | File . join ( @root , f ) } . sort ,
138
+ assert_equal ( [ @root ] + ( "a" .. "z" ) . map { |f | File . join ( @root , f ) } . sort ,
139
139
Dir . glob ( @root + "\0 \0 \0 " + File . join ( @root , "*" ) ) . sort )
140
140
141
- assert_equal ( ( ?a..?z ) . step ( 2 ) . map { |f | File . join ( File . join ( @root , f ) , "" ) } . sort ,
141
+ assert_equal ( ( "a" .. "z" ) . step ( 2 ) . map { |f | File . join ( File . join ( @root , f ) , "" ) } . sort ,
142
142
Dir . glob ( File . join ( @root , "*/" ) ) . sort )
143
143
assert_equal ( [ File . join ( @root , '//a' ) ] , Dir . glob ( @root + '//a' ) )
144
144
@@ -149,7 +149,7 @@ def test_glob
149
149
assert_equal ( [ ] , Dir . glob ( File . join ( @root , '[a-\\' ) ) )
150
150
151
151
assert_equal ( [ File . join ( @root , "a" ) ] , Dir . glob ( File . join ( @root , 'a\\' ) ) )
152
- assert_equal ( ( ?a..?f ) . map { |f | File . join ( @root , f ) } . sort , Dir . glob ( File . join ( @root , '[abc/def]' ) ) . sort )
152
+ assert_equal ( ( "a" .. "f" ) . map { |f | File . join ( @root , f ) } . sort , Dir . glob ( File . join ( @root , '[abc/def]' ) ) . sort )
153
153
end
154
154
155
155
def test_glob_recursive
@@ -180,7 +180,7 @@ def test_glob_recursive
180
180
181
181
def assert_entries ( entries )
182
182
entries . sort!
183
- assert_equal ( %w( . .. ) + ( ?a..?z ) . to_a , entries )
183
+ assert_equal ( %w( . .. ) + ( "a" .. "z" ) . to_a , entries )
184
184
end
185
185
186
186
def test_entries
@@ -220,18 +220,18 @@ def test_unknown_keywords
220
220
221
221
def test_symlink
222
222
begin
223
- [ "dummy" , *?a..?z ] . each do |f |
223
+ [ "dummy" , *"a" .. "z" ] . each do |f |
224
224
File . symlink ( File . join ( @root , f ) ,
225
225
File . join ( @root , "symlink-#{ f } " ) )
226
226
end
227
227
rescue NotImplementedError , Errno ::EACCES
228
228
return
229
229
end
230
230
231
- assert_equal ( [ *?a..?z , *"symlink-a" .."symlink-z" ] . each_slice ( 2 ) . map { |f , _ | File . join ( @root , f + "/" ) } . sort ,
231
+ assert_equal ( [ *"a" .. "z" , *"symlink-a" .."symlink-z" ] . each_slice ( 2 ) . map { |f , _ | File . join ( @root , f + "/" ) } . sort ,
232
232
Dir . glob ( File . join ( @root , "*/" ) ) . sort )
233
233
234
- assert_equal ( [ @root + "/" , *[ *?a..?z ] . each_slice ( 2 ) . map { |f , _ | File . join ( @root , f + "/" ) } . sort ] ,
234
+ assert_equal ( [ @root + "/" , *[ *"a" .. "z" ] . each_slice ( 2 ) . map { |f , _ | File . join ( @root , f + "/" ) } . sort ] ,
235
235
Dir . glob ( File . join ( @root , "**/" ) ) . sort )
236
236
end
237
237
0 commit comments