mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
* test/rexml/test_contrib.rb: Indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
313fa18033
commit
ba3d2f4ac2
36 changed files with 5153 additions and 5149 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue May 27 22:10:30 2014 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
* test/rexml/test_contrib.rb: Indent.
|
||||||
|
|
||||||
Tue May 27 21:28:16 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
Tue May 27 21:28:16 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/ifaddr.c (ifaddr_inspect_flags): support IFF_SIMPLEX.
|
* ext/socket/ifaddr.c (ifaddr_inspect_flags): support IFF_SIMPLEX.
|
||||||
|
|
|
@ -2,7 +2,7 @@ require "test/unit"
|
||||||
require "rexml/document"
|
require "rexml/document"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
||||||
private
|
private
|
||||||
def xml(internal_subset)
|
def xml(internal_subset)
|
||||||
<<-XML
|
<<-XML
|
||||||
|
@ -45,5 +45,5 @@ class TestParseDocumentTypeDeclaration < Test::Unit::TestCase
|
||||||
doctype.children.collect(&:class))
|
doctype.children.collect(&:class))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestParseNotationDeclaration < Test::Unit::TestCase
|
class TestParseNotationDeclaration < Test::Unit::TestCase
|
||||||
private
|
private
|
||||||
def xml(internal_subset)
|
def xml(internal_subset)
|
||||||
<<-XML
|
<<-XML
|
||||||
|
@ -95,5 +95,5 @@ class TestParseNotationDeclaration < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'test/unit/testcase'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class AttributesTester < Test::Unit::TestCase
|
class AttributesTester < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
def test_accessor
|
def test_accessor
|
||||||
doc = Document.new("<a xmlns:foo='a' xmlns:bar='b' foo:att='1' bar:att='2' att='3'/>")
|
doc = Document.new("<a xmlns:foo='a' xmlns:bar='b' foo:att='1' bar:att='2' att='3'/>")
|
||||||
|
@ -218,5 +218,5 @@ XML
|
||||||
],
|
],
|
||||||
child.attributes.to_a.collect(&:to_string).sort)
|
child.attributes.to_a.collect(&:to_string).sort)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestAttributes < Test::Unit::TestCase
|
class TestAttributes < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@ns_a = "urn:x-test:a"
|
@ns_a = "urn:x-test:a"
|
||||||
@ns_b = "urn:x-test:b"
|
@ns_b = "urn:x-test:b"
|
||||||
|
@ -27,5 +27,5 @@ class TestAttributes < Test::Unit::TestCase
|
||||||
assert_equal("5", @attributes.get_attribute_ns(@ns_a, "e").value)
|
assert_equal("5", @attributes.get_attribute_ns(@ns_a, "e").value)
|
||||||
assert_equal("6", @attributes.get_attribute_ns(@ns_b, "f").value)
|
assert_equal("6", @attributes.get_attribute_ns(@ns_b, "f").value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require 'rexml/encoding'
|
require 'rexml/encoding'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class ChangingEncodings < Test::Unit::TestCase
|
class ChangingEncodings < Test::Unit::TestCase
|
||||||
def initialize a
|
def initialize a
|
||||||
@u = 'テスト ほげ ふが 美しい'
|
@u = 'テスト ほげ ふが 美しい'
|
||||||
@e = @u.encode("EUC-JP")
|
@e = @u.encode("EUC-JP")
|
||||||
|
@ -40,5 +40,5 @@ class ChangingEncodings < Test::Unit::TestCase
|
||||||
# @f.decode(@u) == @u
|
# @f.decode(@u) == @u
|
||||||
#}
|
#}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ require "rexml/parseexception"
|
||||||
require "rexml/formatters/default"
|
require "rexml/formatters/default"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class ContribTester < Test::Unit::TestCase
|
class ContribTester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ EOL
|
||||||
def test_namespace_serialization_tobi_reif
|
def test_namespace_serialization_tobi_reif
|
||||||
doc = Document.new '<doc xmlns:b="http://www.foo.foo">
|
doc = Document.new '<doc xmlns:b="http://www.foo.foo">
|
||||||
<b:p/>
|
<b:p/>
|
||||||
</doc>'
|
</doc>'
|
||||||
ns = 'http://www.foo.foo'
|
ns = 'http://www.foo.foo'
|
||||||
ns_declaration={'f'=>ns}
|
ns_declaration={'f'=>ns}
|
||||||
returned = XPath.match(doc,'//f:p',ns_declaration)
|
returned = XPath.match(doc,'//f:p',ns_declaration)
|
||||||
|
@ -579,5 +579,5 @@ EOL
|
||||||
# 'namespace should still be "http://www.foo.foo" and not ""'
|
# 'namespace should still be "http://www.foo.foo" and not ""'
|
||||||
end
|
end
|
||||||
=end
|
=end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@ require "rexml/undefinednamespaceexception"
|
||||||
require_relative "listener"
|
require_relative "listener"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class Tester < Test::Unit::TestCase
|
class Tester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
def setup
|
def setup
|
||||||
|
@ -1460,5 +1460,5 @@ ENDXML
|
||||||
def attribute(name, value)
|
def attribute(name, value)
|
||||||
REXML::Attribute.new(name, value)
|
REXML::Attribute.new(name, value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestDocTypeAccessor < Test::Unit::TestCase
|
class TestDocTypeAccessor < Test::Unit::TestCase
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@sysid = "urn:x-test:sysid1"
|
@sysid = "urn:x-test:sysid1"
|
||||||
|
@ -62,9 +62,9 @@ class TestDocTypeAccessor < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestNotationDeclPublic < Test::Unit::TestCase
|
class TestNotationDeclPublic < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@name = "vrml"
|
@name = "vrml"
|
||||||
@id = "VRML 1.0"
|
@id = "VRML 1.0"
|
||||||
|
@ -85,9 +85,9 @@ class TestNotationDeclPublic < Test::Unit::TestCase
|
||||||
def decl(id, uri)
|
def decl(id, uri)
|
||||||
REXML::NotationDecl.new(@name, "PUBLIC", id, uri)
|
REXML::NotationDecl.new(@name, "PUBLIC", id, uri)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestNotationDeclSystem < Test::Unit::TestCase
|
class TestNotationDeclSystem < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@name = "gif"
|
@name = "gif"
|
||||||
@id = "gif viewer"
|
@id = "gif viewer"
|
||||||
|
@ -102,5 +102,5 @@ class TestNotationDeclSystem < Test::Unit::TestCase
|
||||||
def decl(id)
|
def decl(id)
|
||||||
REXML::NotationDecl.new(@name, "SYSTEM", id, nil)
|
REXML::NotationDecl.new(@name, "SYSTEM", id, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'test/unit/testcase'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class ElementsTester < Test::Unit::TestCase
|
class ElementsTester < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
def test_accessor
|
def test_accessor
|
||||||
doc = Document.new '<a><b/><c id="1"/><c id="2"/><d/></a>'
|
doc = Document.new '<a><b/><c id="1"/><c id="2"/><d/></a>'
|
||||||
|
@ -114,5 +114,5 @@ class ElementsTester < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
assert_equal 6, r
|
assert_equal 6, r
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ require 'rexml/source'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class EncodingTester < Test::Unit::TestCase
|
class EncodingTester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
|
|
||||||
|
@ -92,5 +92,5 @@ class EncodingTester < Test::Unit::TestCase
|
||||||
assert_equal(utf16.encoding, "UTF-16")
|
assert_equal(utf16.encoding, "UTF-16")
|
||||||
assert( utf16[0].kind_of?(REXML::XMLDecl))
|
assert( utf16[0].kind_of?(REXML::XMLDecl))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'rexml/entity'
|
||||||
require 'rexml/source'
|
require 'rexml/source'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class EntityTester < Test::Unit::TestCase
|
class EntityTester < Test::Unit::TestCase
|
||||||
def test_parse_general_decl
|
def test_parse_general_decl
|
||||||
simple = "<!ENTITY foo 'bar'>"
|
simple = "<!ENTITY foo 'bar'>"
|
||||||
simple =~ /#{REXML::Entity::GEDECL}/
|
simple =~ /#{REXML::Entity::GEDECL}/
|
||||||
|
@ -185,5 +185,5 @@ XML
|
||||||
raw,
|
raw,
|
||||||
entity_filter).to_s)
|
entity_filter).to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require "test/unit/testcase"
|
||||||
require "rexml/document"
|
require "rexml/document"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class FunctionsTester < Test::Unit::TestCase
|
class FunctionsTester < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
def test_functions
|
def test_functions
|
||||||
# trivial text() test
|
# trivial text() test
|
||||||
|
@ -220,5 +220,5 @@ class FunctionsTester < Test::Unit::TestCase
|
||||||
m = REXML::XPath.match(doc, "//comment()[#{predicate}]")
|
m = REXML::XPath.match(doc, "//comment()[#{predicate}]")
|
||||||
assert_equal( [REXML::Comment.new("COMMENT A")], m )
|
assert_equal( [REXML::Comment.new("COMMENT A")], m )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'test/unit'
|
||||||
require 'rexml/functions'
|
require 'rexml/functions'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TC_Rexml_Functions_Number < Test::Unit::TestCase
|
class TC_Rexml_Functions_Number < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_functions_number_int
|
def test_functions_number_int
|
||||||
telem = REXML::Element.new("elem")
|
telem = REXML::Element.new("elem")
|
||||||
|
@ -30,5 +30,5 @@ class TC_Rexml_Functions_Number < Test::Unit::TestCase
|
||||||
# telem.text="9.13E12"
|
# telem.text="9.13E12"
|
||||||
# assert_equal(9.13E12, REXML::Functions::number(telem))
|
# assert_equal(9.13E12, REXML::Functions::number(telem))
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ require "rexml/xpath"
|
||||||
# ryan.a.cox@gmail.com
|
# ryan.a.cox@gmail.com
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class JaxenTester < Test::Unit::TestCase
|
class JaxenTester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
|
|
||||||
|
@ -124,5 +124,5 @@ class JaxenTester < Test::Unit::TestCase
|
||||||
namespaces[prefix] = ctx.namespaces[prefix]
|
namespaces[prefix] = ctx.namespaces[prefix]
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require "rexml/light/node"
|
||||||
require "rexml/parsers/lightparser"
|
require "rexml/parsers/lightparser"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class LightTester < Test::Unit::TestCase
|
class LightTester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML::Light
|
include REXML::Light
|
||||||
|
|
||||||
|
@ -102,5 +102,5 @@ class LightTester < Test::Unit::TestCase
|
||||||
r
|
r
|
||||||
end
|
end
|
||||||
=end
|
=end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require_relative 'rexml_test_utils'
|
||||||
require 'rexml/parsers/lightparser'
|
require 'rexml/parsers/lightparser'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class LightParserTester < Test::Unit::TestCase
|
class LightParserTester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
def test_parsing
|
def test_parsing
|
||||||
|
@ -10,5 +10,5 @@ class LightParserTester < Test::Unit::TestCase
|
||||||
parser = REXML::Parsers::LightParser.new( f )
|
parser = REXML::Parsers::LightParser.new( f )
|
||||||
parser.parse
|
parser.parse
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ require 'rexml/document'
|
||||||
require 'rexml/streamlistener'
|
require 'rexml/streamlistener'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class BaseTester < Test::Unit::TestCase
|
class BaseTester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
def test_empty
|
def test_empty
|
||||||
return unless defined? @listener
|
return unless defined? @listener
|
||||||
|
@ -98,9 +98,9 @@ class BaseTester < Test::Unit::TestCase
|
||||||
AccentListener::new
|
AccentListener::new
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class MyREXMLListener
|
class MyREXMLListener
|
||||||
include REXML::StreamListener
|
include REXML::StreamListener
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
|
@ -116,9 +116,9 @@ class MyREXMLListener
|
||||||
def text( text )
|
def text( text )
|
||||||
@text << text
|
@text << text
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class REXMLTester < BaseTester
|
class REXMLTester < BaseTester
|
||||||
def setup
|
def setup
|
||||||
@listener = MyREXMLListener.new
|
@listener = MyREXMLListener.new
|
||||||
end
|
end
|
||||||
|
@ -127,5 +127,5 @@ class REXMLTester < BaseTester
|
||||||
t6 = %Q{<string>
</string>}
|
t6 = %Q{<string>
</string>}
|
||||||
assert_equal( t6.strip, REXML::Document.new(t6).to_s )
|
assert_equal( t6.strip, REXML::Document.new(t6).to_s )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class OrderTester < Test::Unit::TestCase
|
class OrderTester < Test::Unit::TestCase
|
||||||
DOC = <<END
|
DOC = <<END
|
||||||
<paper>
|
<paper>
|
||||||
<title>Remove this element and figs order differently</title>
|
<title>Remove this element and figs order differently</title>
|
||||||
|
@ -35,5 +35,5 @@ END
|
||||||
def test_fig4
|
def test_fig4
|
||||||
assert_equal 'fig4', @figs[3].attributes['src']
|
assert_equal 'fig4', @figs[3].attributes['src']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require_relative "rexml_test_utils"
|
||||||
require "rexml/document"
|
require "rexml/document"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestNamespace < Test::Unit::TestCase
|
class TestNamespace < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
|
|
||||||
|
@ -36,5 +36,5 @@ XML
|
||||||
assert_equal("http://www.w3.org/XML/1998/namespace",
|
assert_equal("http://www.w3.org/XML/1998/namespace",
|
||||||
document.root.namespace("xml"))
|
document.root.namespace("xml"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class OrderTester < Test::Unit::TestCase
|
class OrderTester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
|
|
||||||
TESTDOC = <<END
|
TESTDOC = <<END
|
||||||
|
@ -103,5 +103,5 @@ END
|
||||||
count += 1
|
count += 1
|
||||||
}
|
}
|
||||||
end if defined?(Zlib::GzipReader)
|
end if defined?(Zlib::GzipReader)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,9 +3,9 @@ require 'test/unit'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
# daz - for report by Dan Kohn in:
|
# daz - for report by Dan Kohn in:
|
||||||
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/156328
|
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/156328
|
||||||
class XPathTesterDd < Test::Unit::TestCase
|
class XPathTesterDd < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
@ -36,5 +36,5 @@ class XPathTesterDd < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
assert_equal( "<b x='ab01A'><c y='abc01A'>Success</c></b>", arr.join )
|
assert_equal( "<b x='ab01A'><c y='abc01A'>Success</c></b>", arr.join )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require "test/unit/testcase"
|
||||||
require 'rexml/parsers/pullparser'
|
require 'rexml/parsers/pullparser'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class PullParserTester < Test::Unit::TestCase
|
class PullParserTester < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
def test_basics
|
def test_basics
|
||||||
source = '<?xml version="1.0"?>
|
source = '<?xml version="1.0"?>
|
||||||
|
@ -98,5 +98,5 @@ class PullParserTester < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
assert_equal( 0, names.length )
|
assert_equal( 0, names.length )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require_relative 'rexml_test_utils'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestIssuezillaParsing < Test::Unit::TestCase
|
class TestIssuezillaParsing < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
def test_rexml
|
def test_rexml
|
||||||
doc = REXML::Document.new(File.new(fixture_path("ofbiz-issues-full-177.xml")))
|
doc = REXML::Document.new(File.new(fixture_path("ofbiz-issues-full-177.xml")))
|
||||||
|
@ -12,5 +12,5 @@ class TestIssuezillaParsing < Test::Unit::TestCase
|
||||||
ctr += 1
|
ctr += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'rexml/parsers/sax2parser'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class SAX2Tester < Test::Unit::TestCase
|
class SAX2Tester < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
def test_characters
|
def test_characters
|
||||||
|
@ -272,9 +272,9 @@ class SAX2Tester < Test::Unit::TestCase
|
||||||
flunk $!.message
|
flunk $!.message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class MySAX2Listener
|
class MySAX2Listener
|
||||||
include REXML::SAX2Listener
|
include REXML::SAX2Listener
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,12 +4,12 @@ require 'rexml/streamlistener'
|
||||||
require 'stringio'
|
require 'stringio'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class MyListener
|
class MyListener
|
||||||
include REXML::StreamListener
|
include REXML::StreamListener
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
class StreamTester < Test::Unit::TestCase
|
class StreamTester < Test::Unit::TestCase
|
||||||
# Submitted by Han Holl
|
# Submitted by Han Holl
|
||||||
def test_listener
|
def test_listener
|
||||||
data = %Q{<session1 user="han" password="rootWeiler" />\n<session2 user="han" password="rootWeiler" />}
|
data = %Q{<session1 user="han" password="rootWeiler" />\n<session2 user="han" password="rootWeiler" />}
|
||||||
|
@ -87,11 +87,11 @@ class StreamTester < Test::Unit::TestCase
|
||||||
|
|
||||||
assert_equal(["ISOLat2"], listener.entities)
|
assert_equal(["ISOLat2"], listener.entities)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# For test_listener
|
# For test_listener
|
||||||
class RequestReader
|
class RequestReader
|
||||||
attr_reader :doc
|
attr_reader :doc
|
||||||
def initialize(io)
|
def initialize(io)
|
||||||
@stack = []
|
@stack = []
|
||||||
|
@ -125,5 +125,5 @@ class RequestReader
|
||||||
end
|
end
|
||||||
def doctype_end
|
def doctype_end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require "rexml/text"
|
require "rexml/text"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TextTester < Test::Unit::TestCase
|
class TextTester < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
|
|
||||||
def test_shift_operator_chain
|
def test_shift_operator_chain
|
||||||
|
@ -17,5 +17,5 @@ class TextTester < Test::Unit::TestCase
|
||||||
text << "append3\r\n" << "append4\r\n"
|
text << "append3\r\n" << "append4\r\n"
|
||||||
assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s)
|
assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,7 @@ require 'test/unit'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class Ticket80 < Test::Unit::TestCase
|
class Ticket80 < Test::Unit::TestCase
|
||||||
|
|
||||||
@@xmlstr = '<?xml version="1.0"?>
|
@@xmlstr = '<?xml version="1.0"?>
|
||||||
<root xmlns="urn:some-xml-ns" xmlns:other="urn:some-other-xml-ns">
|
<root xmlns="urn:some-xml-ns" xmlns:other="urn:some-other-xml-ns">
|
||||||
|
@ -50,7 +50,7 @@ class Ticket80 < Test::Unit::TestCase
|
||||||
assert_equal chk, out
|
assert_equal chk, out
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "rexml/document"
|
||||||
require "rexml/validation/relaxng"
|
require "rexml/validation/relaxng"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class RNGValidation < Test::Unit::TestCase
|
class RNGValidation < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
|
|
||||||
def test_validate
|
def test_validate
|
||||||
|
@ -788,5 +788,5 @@ class RNGValidation < Test::Unit::TestCase
|
||||||
parser.add_listener( validator.reset )
|
parser.add_listener( validator.reset )
|
||||||
assert_nothing_raised { parser.parse }
|
assert_nothing_raised { parser.parse }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ require "rexml/document"
|
||||||
require "test/unit"
|
require "test/unit"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestXmlDeclaration < Test::Unit::TestCase
|
class TestXmlDeclaration < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
xml = <<-'END_XML'
|
xml = <<-'END_XML'
|
||||||
<?xml encoding= 'UTF-8' standalone='yes'?>
|
<?xml encoding= 'UTF-8' standalone='yes'?>
|
||||||
|
@ -31,5 +31,5 @@ class TestXmlDeclaration < Test::Unit::TestCase
|
||||||
assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling)
|
assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling)
|
||||||
assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling)
|
assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'test/unit'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestXPathAttribute < Test::Unit::TestCase
|
class TestXPathAttribute < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@xml = <<-XML
|
@xml = <<-XML
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
@ -25,5 +25,5 @@ class TestXPathAttribute < Test::Unit::TestCase
|
||||||
children = REXML::XPath.each(@document, "/root/child[@name='two']")
|
children = REXML::XPath.each(@document, "/root/child[@name='two']")
|
||||||
assert_equal(["child2"], children.collect(&:text))
|
assert_equal(["child2"], children.collect(&:text))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require "test/unit/testcase"
|
||||||
require "rexml/document"
|
require "rexml/document"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
SOURCE = <<-EOF
|
SOURCE = <<-EOF
|
||||||
<a id='1'>
|
<a id='1'>
|
||||||
|
@ -35,5 +35,5 @@ class TestXPathAxisPredcedingSibling < Test::Unit::TestCase
|
||||||
prev = XPath.first(context, "preceding-sibling::f[3]")
|
prev = XPath.first(context, "preceding-sibling::f[3]")
|
||||||
assert_equal "3", prev.attributes["id"]
|
assert_equal "3", prev.attributes["id"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require_relative "../rexml_test_utils"
|
||||||
require "rexml/document"
|
require "rexml/document"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestXPathBase < Test::Unit::TestCase
|
class TestXPathBase < Test::Unit::TestCase
|
||||||
include REXMLTestUtils
|
include REXMLTestUtils
|
||||||
include REXML
|
include REXML
|
||||||
SOURCE = <<-EOF
|
SOURCE = <<-EOF
|
||||||
|
@ -1077,5 +1077,5 @@ EOF
|
||||||
end
|
end
|
||||||
assert_equal(["/"], hrefs, "Bug #3842 [ruby-core:32447]")
|
assert_equal(["/"], hrefs, "Bug #3842 [ruby-core:32447]")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ require_relative "../rexml_test_utils"
|
||||||
require "rexml/document"
|
require "rexml/document"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestXPathNode < Test::Unit::TestCase
|
class TestXPathNode < Test::Unit::TestCase
|
||||||
def matches(xml, xpath)
|
def matches(xml, xpath)
|
||||||
document = REXML::Document.new(xml)
|
document = REXML::Document.new(xml)
|
||||||
REXML::XPath.each(document, xpath).collect(&:to_s)
|
REXML::XPath.each(document, xpath).collect(&:to_s)
|
||||||
|
@ -38,5 +38,5 @@ class TestXPathNode < Test::Unit::TestCase
|
||||||
matches(xml, "/root/non-àscii/child"))
|
matches(xml, "/root/non-àscii/child"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "rexml/xpath"
|
||||||
require "rexml/parsers/xpathparser"
|
require "rexml/parsers/xpathparser"
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestXPathPredicate < Test::Unit::TestCase
|
class TestXPathPredicate < Test::Unit::TestCase
|
||||||
include REXML
|
include REXML
|
||||||
SRC=<<-EOL
|
SRC=<<-EOL
|
||||||
<article>
|
<article>
|
||||||
|
@ -78,5 +78,5 @@ XML
|
||||||
REXML::Comment.new("COMMENT")],
|
REXML::Comment.new("COMMENT")],
|
||||||
m )
|
m )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'rexml/element'
|
||||||
require 'rexml/xpath'
|
require 'rexml/xpath'
|
||||||
|
|
||||||
module REXMLTests
|
module REXMLTests
|
||||||
class TestXPathText < Test::Unit::TestCase
|
class TestXPathText < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@doc = REXML::Document.new
|
@doc = REXML::Document.new
|
||||||
end
|
end
|
||||||
|
@ -70,5 +70,5 @@ class TestXPathText < Test::Unit::TestCase
|
||||||
assert_equal(2, nodes.size, "<b> has two node ancestors")
|
assert_equal(2, nodes.size, "<b> has two node ancestors")
|
||||||
assert nodes[1].kind_of?(REXML::Document)
|
assert nodes[1].kind_of?(REXML::Document)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue