parent
43eb509ba1
commit
32c65ec5ed
@ -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 +1 @@
|
|||||||
SHA512 (Perl-Tidy-Sweetened-1.16.tar.gz) = 5ecd9771a3d375e46f07f9c3254059fabb26cb3deaa7d252edc501c3beefdceffa12586da58723296e3cdbfe9a8b73d31a2d895942280fb0701a13d9e84dd8fb
|
SHA512 (Perl-Tidy-Sweetened-1.17.tar.gz) = 8be636e96803273be746daf4ec6d170a7332ee14acefa271d88a261bfc3ad463804a5e9ce96c911f1d7ac316bd32467cdb88debbabf202b4fae7e717c58b3472
|
||||||
|
Loading…
Reference in new issue