diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-28 09:29:07 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-28 09:29:07 +0000 |
commit | d57fc5a48922bbdcc6ab8dc0c2e02fe796c70afc (patch) | |
tree | 4b8b4badc2992575205492d70e99dd09f72ce3e7 | |
parent | 1e14eb61c9fad7030def09fc4df37da1da0f50b9 (diff) | |
download | ruby-d57fc5a48922bbdcc6ab8dc0c2e02fe796c70afc.tar.gz |
* lib/xsd/charset.rb: XSD::Charset.is_ces did return always true under
$KCODE = "NONE" environment. check added.
* test/xsd/test_xsd.rb: add tests for above fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | test/xsd/test_xsd.rb | 27 |
2 files changed, 32 insertions, 4 deletions
@@ -1,9 +1,16 @@ +Mon Sep 27 18:25:13 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> + + * lib/xsd/charset.rb: XSD::Charset.is_ces did return always true under + $KCODE = "NONE" environment. check added. + + * test/xsd/test_xsd.rb: add tests for above fix. + Mon Sep 27 15:58:50 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> * lib/soap/rpc/cgistub.rb: make logging severity threshold higher. * lib/soap/rpc/standaloneServer.rb: defer WEBrick server start to give - a change to reset logging severity threshold. + a chance to reset logging severity threshold. * test/soap/calc/test_*, test/soap/helloworld/test_helloworld.rb: run silent. diff --git a/test/xsd/test_xsd.rb b/test/xsd/test_xsd.rb index bbcbc9c778..818ad51988 100644 --- a/test/xsd/test_xsd.rb +++ b/test/xsd/test_xsd.rb @@ -7,11 +7,9 @@ module XSD class TestXSD < Test::Unit::TestCase def setup - # Nothing to do. end def teardown - # Nothing to do. end def assert_parsed_result(klass, str) @@ -48,7 +46,7 @@ class TestXSD < Test::Unit::TestCase assert_equal('var', o.to_s) end - def test_XSDString + def test_XSDString_UTF8 o = XSD::XSDString.new assert_equal(XSD::Namespace, o.type.namespace) assert_equal(XSD::StringLiteral, o.type.name) @@ -66,6 +64,29 @@ class TestXSD < Test::Unit::TestCase end end + def test_XSDString_NONE + XSD::Charset.module_eval { @encoding_backup = @encoding; @encoding = "NONE" } + begin + o = XSD::XSDString.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::StringLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, XSD::XSDString.new(str).data) + assert_equal(str, XSD::XSDString.new(str).to_s) + assert_raises(XSD::ValueSpaceError) do + XSD::XSDString.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + p XSD::XSDString.new("\xC0\xC0").to_s + end + ensure + XSD::Charset.module_eval { @encoding = @encoding_backup } + end + end + def test_XSDBoolean o = XSD::XSDBoolean.new assert_equal(XSD::Namespace, o.type.namespace) |