Daniel Frett avatar Daniel Frett committed c611774

added a test case that applies an XPath expression against adjacent text nodes

Comments (0)

Files changed (1)

 use warnings;
 
 # Should be 53
-use Test::More tests => 53;
+use Test::More tests => 54;
 
 use XML::LibXML;
 
     _utf16_content_test(\@nodes, 'p content is fine.');
 }
 
+{
+    # from #69096
+    my $doc = XML::LibXML::Document->createDocument('1.0', 'utf-8');
+    my $root = $doc->createElement('root');
+    $doc->setDocumentElement($root);
+    my $e = $doc->createElement("child");
+    my $e2 = $doc->createElement("child");
+    my $t1 = $doc->createTextNode( "te" );
+    my $t2 = $doc->createTextNode( "st" );
+    $root->appendChild($e);
+    $root->appendChild($e2);
+    $e2->appendChild($t1);
+    $e2->appendChild($t2);
+
+    $doc->normalize();
+    my @cn = $doc->findnodes('//child[text()="test"]');
+    # TEST
+    is( scalar( @cn ), 1, 'xpath testing adjacent text nodes' );
+}
+
 sub _utf16_content_test
 {
     local $Test::Builder::Level = $Test::Builder::Level + 1;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.