public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/perl-XML-LibXML-Devel-SetLineNumber] rawhide: Adapt tests to libxml-2.15.4
Date: Thu, 24 Sep 2026 10:34:59 GMT	[thread overview]
Message-ID: <179024609985.1.16517733119943446375.rpms-perl-XML-LibXML-Devel-SetLineNumber-308c8fb9d913@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/perl-XML-LibXML-Devel-SetLineNumber
Branch : rawhide
Commit : 308c8fb9d9134436e77f88afcd70a9c9292313d0
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-09-24T12:18:05+02:00
Stats  : +70/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-XML-LibXML-Devel-SetLineNumber/c/308c8fb9d9134436e77f88afcd70a9c9292313d0?branch=rawhide

Log:
Adapt tests to libxml-2.15.4

---
diff --git a/XML-LibXML-Devel-SetLineNumber-0.002-Adapt-tests-to-libxml-2.15.4.patch b/XML-LibXML-Devel-SetLineNumber-0.002-Adapt-tests-to-libxml-2.15.4.patch
new file mode 100644
index 0000000..e4a45d9
--- /dev/null
+++ b/XML-LibXML-Devel-SetLineNumber-0.002-Adapt-tests-to-libxml-2.15.4.patch
@@ -0,0 +1,62 @@
+From 97d22b2f7b9ebc4d91b54488d6cffc3868232b7a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Thu, 24 Sep 2026 12:04:30 +0200
+Subject: [PATCH] Adapt tests to libxml-2.15.4
+
+After upggrading libxml from 2.13.9 to 2.15.4 (and rebuilding
+XML-LibXML), t/02working.t started to fail:
+
+    #   Failed test 'BEFORE 1'
+    #   at t/02working.t line 18.
+    #          got: '1'
+    #     expected: '0'
+    #   Failed test 'BEFORE 2'
+    #   at t/02working.t line 18.
+    #          got: '2'
+    #     expected: '0'
+    #   Failed test 'BEFORE 3'
+    #   at t/02working.t line 18.
+    #          got: '3'
+    #     expected: '0'
+    # Looks like you failed 3 tests of 6.
+    t/02working.t ..
+
+The cause was that old libxml always reported line number as
+0 regardless which line the XML element was on and the test expected
+it. New libxml report correct line numbers.
+
+This patch changes the test to accept both values and also changes the
+setting test to use numbers different from the now default values to
+make sure setting the line numbers actually work.
+---
+ t/02working.t | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/t/02working.t b/t/02working.t
+index ff1b264..df903e0 100644
+--- a/t/02working.t
++++ b/t/02working.t
+@@ -15,15 +15,17 @@ plan tests => 2*@nodes;
+ 
+ for my $i (1 .. @nodes)
+ {
+-	is($nodes[$i-1]->line_number, 0, "BEFORE $i");
++	my $value = $nodes[$i-1]->line_number;
++	# libxml-2.15.4 reports $i, libxml-2.13.9 reports 0
++	ok ($value == $i || $value == 0, "BEFORE $i");
+ }
+ 
+ for my $i (1 .. @nodes)
+ {
+-	set_line_number($nodes[$i-1], $i);
++	set_line_number($nodes[$i-1], $i + 42);
+ }
+ 
+ for my $i (1 .. @nodes)
+ {
+-	is($nodes[$i-1]->line_number, $i, "AFTER $i");
++	is($nodes[$i-1]->line_number, $i + 42, "AFTER $i");
+ }
+-- 
+2.55.0
+

diff --git a/perl-XML-LibXML-Devel-SetLineNumber.spec b/perl-XML-LibXML-Devel-SetLineNumber.spec
index 4f7bd8e..eee43a2 100644
--- a/perl-XML-LibXML-Devel-SetLineNumber.spec
+++ b/perl-XML-LibXML-Devel-SetLineNumber.spec
@@ -1,6 +1,6 @@
 Name:           perl-XML-LibXML-Devel-SetLineNumber
 Version:        0.002
-Release:        35%{?dist}
+Release:        36%{?dist}
 Summary:        Set the line number for an XML::LibXML::Node
 # README:       GPL+ or Artistic
 # COPYRIGHT:    Public Domain
@@ -9,6 +9,9 @@ Summary:        Set the line number for an XML::LibXML::Node
 License:        (GPL-1.0-or-later OR Artistic-1.0-Perl) AND ((GPL-1.0-or-later OR Artistic-1.0-Perl) OR LicenseRef-Callaway-CC-BY-SA) AND LicenseRef-Callaway-Public-Domain
 URL:            https://metacpan.org/release/XML-LibXML-Devel-SetLineNumber
 Source0:        https://cpan.metacpan.org/authors/id/T/TO/TOBYINK/XML-LibXML-Devel-SetLineNumber-%{version}.tar.gz
+# Adapt tests to libxml-2.15.4, proposed upstream, bug #2539975,
+# <https://github.com/tobyink/p5-xml-libxml-devel-setlinenumber/pull/1>
+Patch0:         XML-LibXML-Devel-SetLineNumber-0.002-Adapt-tests-to-libxml-2.15.4.patch
 BuildRequires:  gcc
 BuildRequires:  findutils
 BuildRequires:  make
@@ -40,7 +43,7 @@ all those nodes to return the correct line numbers when the "line_number"
 method is called on them. This Perl module allows you to set the line number.
 
 %prep
-%setup -q -n XML-LibXML-Devel-SetLineNumber-%{version}
+%autosetup -p1 -n XML-LibXML-Devel-SetLineNumber-%{version}
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
@@ -63,6 +66,9 @@ make test
 %{_mandir}/man3/*
 
 %changelog
+* Thu Sep 24 2026 Petr Pisar <ppisar@redhat.com> - 0.002-36
+- Adapt tests to libxml-2.15.4 (bug #2539975)
+
 * Thu Sep 10 2026 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.002-35
 - Rebuilt for libxml-2.5.4
 

                 reply	other threads:[~2026-09-24 10:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179024609985.1.16517733119943446375.rpms-perl-XML-LibXML-Devel-SetLineNumber-308c8fb9d913@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox