Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/trunk/test/soap/test_generator.rb

Revision 1947, 490 bytes (checked in by nahi, 1 year ago)
  • XML encoding does not work properly depending on CES. Generator should use an escaping Regexp according to XSD::Charset.encoding. including cosmetic changes ("NONE" -> 'NONE') closes #417.
Line 
1 require 'test/unit'
2 require 'soap/processor'
3
4
5 module SOAP
6
7
8 class TestGenerator < Test::Unit::TestCase
9   # based on #417, reported by Kou.
10   def test_encode
11     str = "\343\201\217<"
12     g = SOAP::Generator.new
13     g.generate(SOAPElement.new('foo'))
14     assert_equal("&lt;", g.encode_string(str)[-4, 4])
15     #
16     begin
17       kc_backup = $KCODE.dup
18       $KCODE = 'EUC-JP'
19       assert_equal("&lt;", g.encode_string(str)[-4, 4])
20     ensure
21       $KCODE = kc_backup
22     end
23   end
24 end
25
26
27 end
Note: See TracBrowser for help on using the browser.