|
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("<", g.encode_string(str)[-4, 4]) |
|---|
| 15 |
# |
|---|
| 16 |
begin |
|---|
| 17 |
kc_backup = $KCODE.dup |
|---|
| 18 |
$KCODE = 'EUC-JP' |
|---|
| 19 |
assert_equal("<", g.encode_string(str)[-4, 4]) |
|---|
| 20 |
ensure |
|---|
| 21 |
$KCODE = kc_backup |
|---|
| 22 |
end |
|---|
| 23 |
end |
|---|
| 24 |
end |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
end |
|---|