f38
Jitka Plesnikova 4 years ago
parent 43eb509ba1
commit 32c65ec5ed

1
.gitignore vendored

@ -6,3 +6,4 @@
/Perl-Tidy-Sweetened-1.14.tar.gz /Perl-Tidy-Sweetened-1.14.tar.gz
/Perl-Tidy-Sweetened-1.15.tar.gz /Perl-Tidy-Sweetened-1.15.tar.gz
/Perl-Tidy-Sweetened-1.16.tar.gz /Perl-Tidy-Sweetened-1.16.tar.gz
/Perl-Tidy-Sweetened-1.17.tar.gz

@ -1,115 +0,0 @@
From 0d39994689ab1f0d6c43e72b96160fd2b742d549 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 22 Oct 2020 14:35:37 +0200
Subject: [PATCH] Adjust tests to Perl-Tidy-20200907
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Perl-Tidy-20200907 changed an indentation of side comments. This patch
adjusts the tests.
https://github.com/mvgrimes/Perl-Tidy-Sweetened/issues/18
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/kavorka.t | 8 ++++----
t/lib/TidierTests.pm | 5 ++++-
t/method-signature-simple.t | 8 ++++----
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/t/kavorka.t b/t/kavorka.t
index efd53f7..9960440 100644
--- a/t/kavorka.t
+++ b/t/kavorka.t
@@ -144,7 +144,7 @@ fun morning ( Str :$name,
}
TIDIED
-run_test( <<'RAW', <<'TIDIED', 'With trailing comments', '', );
+run_test( <<'RAW', <<"TIDIED", 'With trailing comments', '', );
method name1{# Trailing comment
}
sub name2{ # Trailing comment
@@ -153,11 +153,11 @@ RAW
method name1 { # Trailing comment
}
-sub name2 { # Trailing comment
+sub name2 {$indent# Trailing comment
}
TIDIED
-run_test( <<'RAW', <<'TIDIED', 'With attribs trailing comments', '', );
+run_test( <<'RAW', <<"TIDIED", 'With attribs trailing comments', '', );
method name1 :Attrib(Arg) {# comment
}
sub name2 :Attrib(Arg) { # comment
@@ -166,7 +166,7 @@ RAW
method name1 : Attrib(Arg) { # comment
}
-sub name2 : Attrib(Arg) { # comment
+sub name2 : Attrib(Arg) {$indent# comment
}
TIDIED
diff --git a/t/lib/TidierTests.pm b/t/lib/TidierTests.pm
index 61a1bf4..90fd03d 100644
--- a/t/lib/TidierTests.pm
+++ b/t/lib/TidierTests.pm
@@ -7,7 +7,7 @@ use Test::Most;
use Exporter;
@TidierTests::ISA = qw(Exporter);
-@TidierTests::EXPORT = qw(run_test);
+@TidierTests::EXPORT = qw(run_test $indent);
sub run_test {
my ( $raw, $expected, $msg, $todo, @args ) = @_;
@@ -50,4 +50,7 @@ sub check_test {
return $ok_log && $ok_tidy;
}
+require Perl::Tidy;
+our $indent = ' ' x (($Perl::Tidy::VERSION < 20200907) ? 6 : 4);
+
1;
diff --git a/t/method-signature-simple.t b/t/method-signature-simple.t
index a548364..7f66b64 100644
--- a/t/method-signature-simple.t
+++ b/t/method-signature-simple.t
@@ -72,7 +72,7 @@ func morning ( Str :$name,
}
TIDIED
-run_test( <<'RAW', <<'TIDIED', 'With trailing comments', '', );
+run_test( <<'RAW', <<"TIDIED", 'With trailing comments', '', );
method name1{# Trailing comment
}
sub name2{ # Trailing comment
@@ -81,11 +81,11 @@ RAW
method name1 { # Trailing comment
}
-sub name2 { # Trailing comment
+sub name2 {$indent# Trailing comment
}
TIDIED
-run_test( <<'RAW', <<'TIDIED', 'With attribs trailing comments', '', );
+run_test( <<'RAW', <<"TIDIED", 'With attribs trailing comments', '', );
method name1 :Attrib(Arg) {# comment
}
sub name2 :Attrib(Arg) { # comment
@@ -94,7 +94,7 @@ RAW
method name1 : Attrib(Arg) { # comment
}
-sub name2 : Attrib(Arg) { # comment
+sub name2 : Attrib(Arg) {$indent# comment
}
TIDIED
--
2.25.4

@ -1,13 +1,10 @@
Name: perl-Perl-Tidy-Sweetened Name: perl-Perl-Tidy-Sweetened
Version: 1.16 Version: 1.17
Release: 4%{?dist} Release: 1%{?dist}
Summary: Tweaks to Perl::Tidy to support some syntactic sugar Summary: Tweaks to Perl::Tidy to support some syntactic sugar
License: GPL+ or Artistic License: GPL+ or Artistic
URL: https://metacpan.org/release/Perl-Tidy-Sweetened URL: https://metacpan.org/release/Perl-Tidy-Sweetened
Source0: https://cpan.metacpan.org/authors/id/M/MG/MGRIMES/Perl-Tidy-Sweetened-%{version}.tar.gz Source0: https://cpan.metacpan.org/authors/id/M/MG/MGRIMES/Perl-Tidy-Sweetened-%{version}.tar.gz
# Adjust tests to Perl-Tidy-20200907, bug #1879947, proposed to the upstream,
# <https://github.com/mvgrimes/Perl-Tidy-Sweetened/issues/18>
Patch0: Perl-Tidy-Sweetened-1.16-Adjust-tests-to-Perl-Tidy-20200907.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: perl-interpreter BuildRequires: perl-interpreter
@ -34,7 +31,6 @@ come to rely on. This module attempts to work around those issues.
%prep %prep
%setup -q -n Perl-Tidy-Sweetened-%{version} %setup -q -n Perl-Tidy-Sweetened-%{version}
%patch0 -p1
%build %build
perl Build.PL --installdirs=vendor perl Build.PL --installdirs=vendor
@ -56,6 +52,9 @@ perl Build.PL --installdirs=vendor
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Mon Jan 25 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.17-1
- 1.17 bump
* Thu Oct 22 2020 Petr Pisar <ppisar@redhat.com> - 1.16-4 * Thu Oct 22 2020 Petr Pisar <ppisar@redhat.com> - 1.16-4
- Adjust tests to Perl-Tidy-20200907 (bug #1879947) - Adjust tests to Perl-Tidy-20200907 (bug #1879947)

@ -1 +1 @@
SHA512 (Perl-Tidy-Sweetened-1.16.tar.gz) = 5ecd9771a3d375e46f07f9c3254059fabb26cb3deaa7d252edc501c3beefdceffa12586da58723296e3cdbfe9a8b73d31a2d895942280fb0701a13d9e84dd8fb SHA512 (Perl-Tidy-Sweetened-1.17.tar.gz) = 8be636e96803273be746daf4ec6d170a7332ee14acefa271d88a261bfc3ad463804a5e9ce96c911f1d7ac316bd32467cdb88debbabf202b4fae7e717c58b3472

Loading…
Cancel
Save