libxml-ruby 3.2.4-x64-mingw-ucrt → 4.0.0-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_suite.rb DELETED
@@ -1,48 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- # Change to current directory so relative
4
- # requires work.
5
- dir = File.dirname(__FILE__)
6
- Dir.chdir(dir)
7
-
8
- require './test_attr'
9
- require './test_attr_decl'
10
- require './test_attributes'
11
- require './test_canonicalize'
12
- require './test_document'
13
- require './test_document_write'
14
- require './test_dtd'
15
- require './test_error'
16
- require './test_html_parser'
17
- require './test_html_parser_context'
18
- require './test_namespace'
19
- require './test_namespaces'
20
- require './test_node'
21
- require './test_node_cdata'
22
- require './test_node_comment'
23
- require './test_node_copy'
24
- require './test_node_edit'
25
- require './test_node_pi'
26
- require './test_node_text'
27
- require './test_node_write'
28
- require './test_node_xlink'
29
- require './test_parser'
30
- require './test_parser_context'
31
- require './test_reader'
32
- require './test_relaxng'
33
- require './test_sax_parser'
34
- require './test_schema'
35
- require './test_traversal'
36
- require './test_writer'
37
- require './test_xinclude'
38
- require './test_xpath'
39
- require './test_xpath_context'
40
- require './test_xpath_expression'
41
- require './test_xpointer'
42
-
43
- require './test_encoding'
44
- require './test_encoding_sax'
45
-
46
- # Compatibility
47
- require './test_properties'
48
- require './test_deprecated_require'
@@ -1,72 +0,0 @@
1
- # encoding: UTF-8
2
- require_relative './test_helper'
3
-
4
- class TC_XML_XPointer < Minitest::Test
5
- def setup()
6
- xp = LibXML::XML::Parser.string('<!DOCTYPE ra [<!ELEMENT ra (foo+)><!ATTLIST ra id ID #IMPLIED><!ELEMENT foo (#PCDATA)><!ATTLIST foo id ID #IMPLIED>]><ra id="start"><foo id="one">one</foo><foo id="two">two</foo><foo id="three">three</foo></ra>')
7
- @doc = xp.parse
8
- assert_instance_of(LibXML::XML::Document, @doc)
9
- @root = @doc.root
10
- assert_instance_of(LibXML::XML::Node, @root)
11
- end
12
-
13
- def teardown()
14
- @doc = nil
15
- @root = nil
16
- @xptr = nil
17
- end
18
-
19
- def test_libxml_xpointer_id
20
- xptr = @root.pointer('xpointer(id("two"))')
21
- assert_instance_of(LibXML::XML::XPath::Object, xptr)
22
- xptr.each do |node|
23
- # It seems from the spec that the pointer should
24
- # be the whole node, rather than just the ID attr.
25
- assert_equal('two', node.content)
26
- assert_instance_of(LibXML::XML::Node, node)
27
- assert_equal('two', node['id'])
28
- end
29
-
30
- # FIXME: Not sure at all about this kind of range
31
- if ENV['NOTWORKING']
32
- @xptr = @root.pointer('xpointer(id("two")) xpointer(id("three"))')
33
- assert_instance_of(LibXML::XML::XPath, @xptr)
34
- assert_instance_of(LibXML::XML::Node::Set, @xptr.set)
35
- assert_equal(2, @xptr.set.length)
36
- for n in @xptr.set
37
- assert_match(/two|three/, n.to_s)
38
- end
39
- end
40
- end
41
-
42
- # FIXME: There is a bug in these ranges...
43
- if ENV['NOTWORKING']
44
- def test_libxml_xpointer_range()
45
- nstart = nend = nil
46
- @xptr = @root.pointer('xpointer(id("one"))').set
47
- @xptr.each{|n| nstart = n}
48
- assert_instance_of(LibXML::XML::Node, nstart)
49
- @xptr = @root.pointer('xpointer(id("three"))').set
50
- @xptr.each{|n| nend = n}
51
- assert_instance_of(LibXML::XML::Node, nend)
52
- range = LibXML::XML::XPointer.range(nstart, nend)
53
- assert_instance_of(LibXML::XML::XPath, range)
54
- assert_instance_of(LibXML::XML::Node::Set, range.set)
55
-
56
- for n in range.set
57
- assert_match(/one|two|three/, n.to_s)
58
- end
59
- assert_equal(3, range.set.length)
60
- end
61
- end
62
-
63
- # def test_libxml_xpointer_start_point()
64
- # @xptr = @root.pointer('xpointer(start-point("one"))')
65
- # assert_instance_of(LibXML::XML::XPath, @xptr)
66
- # set = @xptr.set
67
- # assert_instance_of(LibXML::XML::Node::Set, set)
68
- # for n in set
69
- # assert_match(/one|two|three/, n.to_s)
70
- # end
71
- # end
72
- end