summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--test/xsd/test_xsd.rb27
2 files changed, 32 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 00d550753f..a6f6fec91f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)