]> git.donarmstrong.com Git - perltidy.git/commitdiff
Add test of --break-on-old-method-breakpoints
authorMeredith Howard <mhoward@roomag.org>
Wed, 6 Mar 2019 01:45:04 +0000 (19:45 -0600)
committerMeredith Howard <mhoward@roomag.org>
Wed, 6 Mar 2019 01:57:36 +0000 (19:57 -0600)
t/snippets/break_old_methods.in [new file with mode: 0644]
t/snippets/break_old_methods.par [new file with mode: 0644]
t/snippets/expect/break_old_methods.break_old_methods [new file with mode: 0644]
t/snippets/expect/break_old_methods.def [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets15.t

diff --git a/t/snippets/break_old_methods.in b/t/snippets/break_old_methods.in
new file mode 100644 (file)
index 0000000..1bc2ab5
--- /dev/null
@@ -0,0 +1,7 @@
+my $q = $rs
+   ->related_resultset('CDs')
+   ->related_resultset('Tracks')
+   ->search({
+      'track.id' => { -ident => 'none_search.id' },
+   })
+   ->as_query;
diff --git a/t/snippets/break_old_methods.par b/t/snippets/break_old_methods.par
new file mode 100644 (file)
index 0000000..eb4040f
--- /dev/null
@@ -0,0 +1 @@
+--break-at-old-method-breakpoints
diff --git a/t/snippets/expect/break_old_methods.break_old_methods b/t/snippets/expect/break_old_methods.break_old_methods
new file mode 100644 (file)
index 0000000..943f5a6
--- /dev/null
@@ -0,0 +1,8 @@
+my $q = $rs
+  ->related_resultset('CDs')
+  ->related_resultset('Tracks')
+  ->search(
+    {
+        'track.id' => { -ident => 'none_search.id' },
+    }
+)->as_query;
diff --git a/t/snippets/expect/break_old_methods.def b/t/snippets/expect/break_old_methods.def
new file mode 100644 (file)
index 0000000..73f30a3
--- /dev/null
@@ -0,0 +1,5 @@
+my $q = $rs->related_resultset('CDs')->related_resultset('Tracks')->search(
+    {
+        'track.id' => { -ident => 'none_search.id' },
+    }
+)->as_query;
index 4a4fc6e81b21b420b8f9f901982042baecfaa2de..53aff695d71685e509b941723bbb352958c3db35 100644 (file)
 ../snippets14.t        gnu5.def
 ../snippets15.t        gnu5.gnu
 ../snippets15.t        wngnu1.def
+../snippets15.t        break_old_methods.break_old_methods
+../snippets15.t        break_old_methods.def
 ../snippets2.t angle.def
 ../snippets2.t arrows1.def
 ../snippets2.t arrows2.def
index 21c705e8a714bdbb65210048c11157527783ded4..c53061f0ed59785c93eda811149e6f686c392c2e 100644 (file)
@@ -3,6 +3,8 @@
 # Contents:
 #1 gnu5.gnu
 #2 wngnu1.def
+#3 break_old_methods.break_old_methods
+#4 break_old_methods.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -20,8 +22,9 @@ BEGIN {
     # BEGIN SECTION 1: Parameter combinations #
     ###########################################
     $rparams = {
-        'def' => "",
-        'gnu' => "-gnu",
+        'break_old_methods' => "--break-at-old-method-breakpoints",
+        'def'               => "",
+        'gnu'               => "-gnu",
     };
 
     ############################
@@ -29,6 +32,16 @@ BEGIN {
     ############################
     $rsources = {
 
+        'break_old_methods' => <<'----------',
+my $q = $rs
+   ->related_resultset('CDs')
+   ->related_resultset('Tracks')
+   ->search({
+      'track.id' => { -ident => 'none_search.id' },
+   })
+   ->as_query;
+----------
+
         'gnu5' => <<'----------',
         # side comments limit gnu type formatting with l=80; note extra comma
         push @tests, [
@@ -102,6 +115,33 @@ BEGIN {
     }
 #2...........
         },
+
+        'break_old_methods.break_old_methods' => {
+            source => "break_old_methods",
+            params => "break_old_methods",
+            expect => <<'#3...........',
+my $q = $rs
+  ->related_resultset('CDs')
+  ->related_resultset('Tracks')
+  ->search(
+    {
+        'track.id' => { -ident => 'none_search.id' },
+    }
+)->as_query;
+#3...........
+        },
+
+        'break_old_methods.def' => {
+            source => "break_old_methods",
+            params => "def",
+            expect => <<'#4...........',
+my $q = $rs->related_resultset('CDs')->related_resultset('Tracks')->search(
+    {
+        'track.id' => { -ident => 'none_search.id' },
+    }
+)->as_query;
+#4...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};