mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/webrick] Manually pick commit from upstream repo
Fix test when run with US-ASCII encoding
f402aafb36
This commit is contained in:
parent
f64bea6d66
commit
588ac990ff
1 changed files with 12 additions and 0 deletions
|
@ -291,6 +291,13 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_multibyte_char_in_path
|
def test_multibyte_char_in_path
|
||||||
|
if Encoding.default_external == Encoding.find('US-ASCII')
|
||||||
|
reset_encoding = true
|
||||||
|
verb = $VERBOSE
|
||||||
|
$VERBOSE = false
|
||||||
|
Encoding.default_external = Encoding.find('UTF-8')
|
||||||
|
end
|
||||||
|
|
||||||
c = "\u00a7"
|
c = "\u00a7"
|
||||||
begin
|
begin
|
||||||
c = c.encode('filesystem')
|
c = c.encode('filesystem')
|
||||||
|
@ -320,6 +327,11 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
if reset_encoding
|
||||||
|
Encoding.default_external = Encoding.find('US-ASCII')
|
||||||
|
$VERBOSE = verb
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_script_disclosure
|
def test_script_disclosure
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue