mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/socket/test_socket.rb: update not to use 1.8 assignment to
external local variable in the block parameters. [ruby-dev:32251] * test/strscan/test_stringscanner.rb: avoid $KCODE, and use String#force_encoding(). [ruby-dev:32251] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e81b38e378
commit
326659c0bf
3 changed files with 24 additions and 32 deletions
|
@ -1,3 +1,11 @@
|
|||
Wed Nov 14 15:39:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* test/socket/test_socket.rb: update not to use 1.8 assignment to
|
||||
external local variable in the block parameters. [ruby-dev:32251]
|
||||
|
||||
* test/strscan/test_stringscanner.rb: avoid $KCODE, and use
|
||||
String#force_encoding(). [ruby-dev:32251]
|
||||
|
||||
Wed Nov 14 14:04:42 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* common.mk, Makefile.in: rename prelude.c to miniprelude.c.
|
||||
|
|
|
@ -38,7 +38,8 @@ class TestBasicSocket < Test::Unit::TestCase
|
|||
s.close
|
||||
linger
|
||||
}
|
||||
inet_stream do |s|
|
||||
inet_stream do |sock|
|
||||
s = sock
|
||||
assert_equal(0, s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, linger))
|
||||
|
||||
assert_raise(IOError) {
|
||||
|
@ -51,7 +52,8 @@ class TestBasicSocket < Test::Unit::TestCase
|
|||
s.close
|
||||
Socket::SO_LINGER
|
||||
}
|
||||
inet_stream do |s|
|
||||
inet_stream do |sock|
|
||||
s = sock
|
||||
assert_raise(IOError) {
|
||||
s.setsockopt(Socket::SOL_SOCKET, val, linger)
|
||||
}
|
||||
|
@ -65,7 +67,8 @@ class TestBasicSocket < Test::Unit::TestCase
|
|||
s.close
|
||||
2
|
||||
}
|
||||
inet_stream do |s|
|
||||
inet_stream do |sock|
|
||||
s = sock
|
||||
assert_raise(IOError) {
|
||||
s.listen(log)
|
||||
}
|
||||
|
|
|
@ -288,15 +288,9 @@ class TestStringScanner < Test::Unit::TestCase
|
|||
assert_equal true, s.getch.tainted?
|
||||
assert_nil s.getch
|
||||
|
||||
kc_backup = $KCODE
|
||||
begin
|
||||
$KCODE = 'EUC'
|
||||
s = StringScanner.new("\244\242")
|
||||
assert_equal "\244\242", s.getch
|
||||
assert_nil s.getch
|
||||
ensure
|
||||
$KCODE = kc_backup
|
||||
end
|
||||
s = StringScanner.new("\244\242".force_encoding("euc-jp"))
|
||||
assert_equal "\244\242", s.getch
|
||||
assert_nil s.getch
|
||||
|
||||
s = StringScanner.new('test')
|
||||
s.scan(/te/)
|
||||
|
@ -322,16 +316,10 @@ class TestStringScanner < Test::Unit::TestCase
|
|||
assert_equal true, s.get_byte.tainted?
|
||||
assert_nil s.get_byte
|
||||
|
||||
kc_backup = $KCODE
|
||||
begin
|
||||
$KCODE = 'EUC'
|
||||
s = StringScanner.new("\244\242")
|
||||
assert_equal "\244", s.get_byte
|
||||
assert_equal "\242", s.get_byte
|
||||
assert_nil s.get_byte
|
||||
ensure
|
||||
$KCODE = kc_backup
|
||||
end
|
||||
s = StringScanner.new("\244\242".force_encoding("euc-jp"))
|
||||
assert_equal "\244", s.get_byte
|
||||
assert_equal "\242", s.get_byte
|
||||
assert_nil s.get_byte
|
||||
|
||||
s = StringScanner.new('test')
|
||||
s.scan(/te/)
|
||||
|
@ -424,16 +412,9 @@ class TestStringScanner < Test::Unit::TestCase
|
|||
assert_nil s[0]
|
||||
|
||||
|
||||
kc_backup = $KCODE
|
||||
begin
|
||||
$KCODE = 'EUC'
|
||||
s = StringScanner.new("\244\242")
|
||||
s.getch
|
||||
assert_equal "\244\242", s[0]
|
||||
ensure
|
||||
$KCODE = kc_backup
|
||||
end
|
||||
|
||||
s = StringScanner.new("\244\242".force_encoding("euc-jp"))
|
||||
s.getch
|
||||
assert_equal "\244\242", s[0]
|
||||
|
||||
str = 'test'
|
||||
str.taint
|
||||
|
|
Loading…
Reference in a new issue