mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
{lib,test}/cgi: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3203ae53ff
commit
fbd5cda6aa
15 changed files with 59 additions and 59 deletions
|
@ -1,4 +1,4 @@
|
|||
# frozen_string_literal: false
|
||||
# frozen_string_literal: true
|
||||
require 'test/unit'
|
||||
require 'cgi'
|
||||
require 'stringio'
|
||||
|
@ -105,11 +105,11 @@ class CGICoreTest < Test::Unit::TestCase
|
|||
hash={}
|
||||
cgi = CGI.new(:accept_charset=>"UTF-8"){|key,val|hash[key]=val}
|
||||
## cgi[]
|
||||
assert_equal("\xBE\xBE\xB9\xBE".force_encoding("UTF-8"), cgi['str'])
|
||||
assert_equal("\xBE\xBE\xB9\xBE".dup.force_encoding("UTF-8"), cgi['str'])
|
||||
## cgi.params
|
||||
assert_equal(["\xBE\xBE\xB9\xBE".force_encoding("UTF-8")], cgi.params['str'])
|
||||
assert_equal(["\xBE\xBE\xB9\xBE".dup.force_encoding("UTF-8")], cgi.params['str'])
|
||||
## accept-charset error
|
||||
assert_equal({"str"=>"\xBE\xBE\xB9\xBE".force_encoding("UTF-8")},hash)
|
||||
assert_equal({"str"=>"\xBE\xBE\xB9\xBE".dup.force_encoding("UTF-8")},hash)
|
||||
|
||||
$stdin.rewind
|
||||
assert_raise(CGI::InvalidEncoding) do
|
||||
|
@ -119,9 +119,9 @@ class CGICoreTest < Test::Unit::TestCase
|
|||
$stdin.rewind
|
||||
cgi = CGI.new(:accept_charset=>"EUC-JP")
|
||||
## cgi[]
|
||||
assert_equal("\xBE\xBE\xB9\xBE".force_encoding("EUC-JP"), cgi['str'])
|
||||
assert_equal("\xBE\xBE\xB9\xBE".dup.force_encoding("EUC-JP"), cgi['str'])
|
||||
## cgi.params
|
||||
assert_equal(["\xBE\xBE\xB9\xBE".force_encoding("EUC-JP")], cgi.params['str'])
|
||||
assert_equal(["\xBE\xBE\xB9\xBE".dup.force_encoding("EUC-JP")], cgi.params['str'])
|
||||
else
|
||||
assert(true)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue