diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-28 09:26:55 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-28 09:26:55 +0000 |
commit | 793e9423cd4c4c679959b7dd011040b5aba2d169 (patch) | |
tree | 034b079d1e8a3b856e8cc5cc96dc3fd185f5d4a8 /test | |
parent | 48af602e38293f53e7c9afa7b41ba778714220f4 (diff) | |
download | ruby-793e9423cd4c4c679959b7dd011040b5aba2d169.tar.gz |
Fri Dec 28 01:55:04 2007 Martin Duerst <duerst@it.aoyama.ac.jp>
* transcode.c (transcode_dispatch): reverted some of the changes
in r14746.
* transcode.c, enc/trans/single_byte.c: Added conversions to/from
US-ASCII and ASCII-8BIT (using data tables).
* enc/trans/single_byte.c: Some spacing/ordering changes due to
automatic data file generation.
* transcode_data.h, transcode.c: Preliminary code for using
micro-conversion functions.
* test/ruby/test_transcode.rb: Added some tests for US-ASCII and
ASCII-8BIT conversions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_transcode.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index 73177a136b..4b3e1e77f3 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -26,6 +26,8 @@ class TestTranscode < Test::Unit::TestCase assert_raise(ArgumentError) { 'abc'.encode!('foo', 'bar') } assert_raise(ArgumentError) { 'abc'.force_encoding('utf-8').encode('foo') } assert_raise(ArgumentError) { 'abc'.force_encoding('utf-8').encode!('foo') } + assert_raise(RuntimeError) { "\x80".encode('utf-8','ASCII-8BIT') } + assert_raise(RuntimeError) { "\x80".encode('utf-8','US-ASCII') } assert_raise(RuntimeError) { "\xA5".encode('utf-8','iso-8859-3') } end @@ -87,6 +89,7 @@ class TestTranscode < Test::Unit::TestCase def test_ascii_range encodings = [ + 'US-ASCII', 'ASCII-8BIT', 'ISO-8859-1', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-9', |