1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nahi 2003-09-28 09:29:07 +00:00
parent 1e14eb61c9
commit d57fc5a489
2 changed files with 32 additions and 4 deletions

View file

@ -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.

View file

@ -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)