@@ -10,7 +10,7 @@ def setup
1010 $VERBOSE = nil
1111 @root = File . realpath ( Dir . mktmpdir ( '__test_dir__' ) )
1212 @nodir = File . join ( @root , "dummy" )
13- for i in ?a..?z
13+ for i in "a" .. "z"
1414 if i . ord % 2 == 0
1515 FileUtils . touch ( File . join ( @root , i ) )
1616 else
@@ -131,14 +131,14 @@ def test_close
131131 end
132132
133133 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 ) } ,
135135 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 ,
137137 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 ,
139139 Dir . glob ( @root + "\0 \0 \0 " + File . join ( @root , "*" ) ) . sort )
140140
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 ,
142142 Dir . glob ( File . join ( @root , "*/" ) ) . sort )
143143 assert_equal ( [ File . join ( @root , '//a' ) ] , Dir . glob ( @root + '//a' ) )
144144
@@ -149,7 +149,7 @@ def test_glob
149149 assert_equal ( [ ] , Dir . glob ( File . join ( @root , '[a-\\' ) ) )
150150
151151 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 )
153153 end
154154
155155 def test_glob_recursive
@@ -180,7 +180,7 @@ def test_glob_recursive
180180
181181 def assert_entries ( entries )
182182 entries . sort!
183- assert_equal ( %w( . .. ) + ( ?a..?z ) . to_a , entries )
183+ assert_equal ( %w( . .. ) + ( "a" .. "z" ) . to_a , entries )
184184 end
185185
186186 def test_entries
@@ -220,18 +220,18 @@ def test_unknown_keywords
220220
221221 def test_symlink
222222 begin
223- [ "dummy" , *?a..?z ] . each do |f |
223+ [ "dummy" , *"a" .. "z" ] . each do |f |
224224 File . symlink ( File . join ( @root , f ) ,
225225 File . join ( @root , "symlink-#{ f } " ) )
226226 end
227227 rescue NotImplementedError , Errno ::EACCES
228228 return
229229 end
230230
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 ,
232232 Dir . glob ( File . join ( @root , "*/" ) ) . sort )
233233
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 ] ,
235235 Dir . glob ( File . join ( @root , "**/" ) ) . sort )
236236 end
237237
0 commit comments