Skip to content

Commit ae05ae3

Browse files
author
kosaki
committed
* test/ruby/test_dir.rb (TestDir#test_fileno): s/?x/"x"/. Don't
use tricky code, please. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 76da19c commit ae05ae3

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Thu Sep 17 12:05:54 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
2+
3+
* test/ruby/test_dir.rb (TestDir#test_fileno): s/?x/"x"/. Don't
4+
use tricky code, please.
5+
16
Wed Sep 16 20:49:56 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
27

38
* encindex.h: fix typo of last #endif comment. [ci skip]

test/ruby/test_dir.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)