]> git.donarmstrong.com Git - perltidy.git/commitdiff
add test for git #47 issue
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 7 Dec 2020 00:58:39 +0000 (16:58 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 7 Dec 2020 00:58:39 +0000 (16:58 -0800)
t/snippets/expect/git47.def [new file with mode: 0644]
t/snippets/expect/git47.git47 [new file with mode: 0644]
t/snippets/git47.in [new file with mode: 0644]
t/snippets/git47.par [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets23.t

diff --git a/t/snippets/expect/git47.def b/t/snippets/expect/git47.def
new file mode 100644 (file)
index 0000000..8f51192
--- /dev/null
@@ -0,0 +1,31 @@
+# cannot weld here
+$promises[$i]->then(
+    sub { $all->resolve(@_); () },
+    sub {
+        $results->[$i] = [@_];
+        $all->reject(@$results) if --$remaining <= 0;
+        return ();
+    }
+);
+
+sub _absolutize {
+    [ map { _is_scoped($_) ? $_ : [ [ [ 'pc', 'scope' ] ], ' ', @$_ ] }
+          @{ shift() } ]
+}
+
+$c->helpers->log->debug(
+    sub {
+        my $req    = $c->req;
+        my $method = $req->method;
+        my $path   = $req->url->path->to_abs_string;
+        $c->helpers->timing->begin('mojo.timer');
+        return qq{$method "$path"};
+    }
+) unless $stash->{'mojo.static'};
+
+# A single signature var can weld
+return Mojo::Promise->resolve($query_params)->then(&_reveal_event)->then(
+    sub ($code) {
+        return $c->render( text => '', status => $code );
+    }
+);
diff --git a/t/snippets/expect/git47.git47 b/t/snippets/expect/git47.git47
new file mode 100644 (file)
index 0000000..d6fec30
--- /dev/null
@@ -0,0 +1,24 @@
+# cannot weld here
+$promises[$i]->then(
+  sub { $all->resolve(@_); () },
+  sub {
+    $results->[$i] = [@_];
+    $all->reject(@$results) if --$remaining <= 0;
+    return ();
+  }
+);
+
+sub _absolutize { [map { _is_scoped($_) ? $_ : [[['pc', 'scope']], ' ', @$_] } @{shift()}] }
+
+$c->helpers->log->debug(sub {
+  my $req    = $c->req;
+  my $method = $req->method;
+  my $path   = $req->url->path->to_abs_string;
+  $c->helpers->timing->begin('mojo.timer');
+  return qq{$method "$path"};
+}) unless $stash->{'mojo.static'};
+
+# A single signature var can weld
+return Mojo::Promise->resolve($query_params)->then(&_reveal_event)->then(sub ($code) {
+  return $c->render(text => '', status => $code);
+});
diff --git a/t/snippets/git47.in b/t/snippets/git47.in
new file mode 100644 (file)
index 0000000..23c5a35
--- /dev/null
@@ -0,0 +1,28 @@
+# cannot weld here
+$promises[$i]->then(
+    sub { $all->resolve(@_); () },
+    sub {
+        $results->[$i] = [@_];
+        $all->reject(@$results) if --$remaining <= 0;
+        return ();
+    }
+);
+
+sub _absolutize { [
+    map { _is_scoped($_) ? $_ : [ [ [ 'pc', 'scope' ] ], ' ', @$_ ] }
+      @{ shift() } ] }
+
+$c->helpers->log->debug( sub {
+    my $req    = $c->req;
+    my $method = $req->method;
+    my $path   = $req->url->path->to_abs_string;
+    $c->helpers->timing->begin('mojo.timer');
+    return qq{$method "$path"};
+} ) unless $stash->{'mojo.static'};
+
+# A single signature var can weld
+return Mojo::Promise->resolve($query_params)->then(&_reveal_event)->then(
+    sub ($code) {
+        return $c->render( text => '', status => $code );
+    }
+);
diff --git a/t/snippets/git47.par b/t/snippets/git47.par
new file mode 100644 (file)
index 0000000..a8ae659
--- /dev/null
@@ -0,0 +1,15 @@
+# perltidyrc from git #47
+-pbp     # Start with Perl Best Practices
+-w       # Show all warnings
+-iob     # Ignore old breakpoints
+-l=120   # 120 characters per line
+-mbl=2   # No more than 2 blank lines
+-i=2     # Indentation is 2 columns
+-ci=2    # Continuation indentation is 2 columns
+-vt=0    # Less vertical tightness
+-pt=2    # High parenthesis tightness
+-bt=2    # High brace tightness
+-sbt=2   # High square bracket tightness
+-wn      # Weld nested containers
+-isbc    # Don't indent comments without leading space
+-nst     # Don't output to STDOUT
index 385985a8bce29b612c74bf8c6525ff4750d638b5..eb1f161d56a4f9b2fefed9a8acdfaf3125959dce 100644 (file)
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
+../snippets23.t        git47.def
+../snippets23.t        git47.git47
index 3b67a41f4bd29f82ceef6fa7f711ea535e88a79b..da8b870aeaa1b04d9518702e1799ba8b00242e88 100644 (file)
@@ -17,6 +17,8 @@
 #14 wnxl.wnxl3
 #15 wnxl.wnxl4
 #16 align34.def
+#17 git47.def
+#18 git47.git47
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -42,7 +44,24 @@ BEGIN {
 # -bot is default so we test -nbot
 -nbot
 ----------
-        'def'       => "",
+        'def'   => "",
+        'git47' => <<'----------',
+# perltidyrc from git #47
+-pbp     # Start with Perl Best Practices
+-w       # Show all warnings
+-iob     # Ignore old breakpoints
+-l=120   # 120 characters per line
+-mbl=2   # No more than 2 blank lines
+-i=2     # Indentation is 2 columns
+-ci=2    # Continuation indentation is 2 columns
+-vt=0    # Less vertical tightness
+-pt=2    # High parenthesis tightness
+-bt=2    # High brace tightness
+-sbt=2   # High square bracket tightness
+-wn      # Weld nested containers
+-isbc    # Don't indent comments without leading space
+-nst     # Don't output to STDOUT
+----------
         'hash_bang' => "-x",
         'listop1'   => <<'----------',
 # -bok is default so we test nbok
@@ -108,6 +127,37 @@ $foo =
   : 1;
 ----------
 
+        'git47' => <<'----------',
+# cannot weld here
+$promises[$i]->then(
+    sub { $all->resolve(@_); () },
+    sub {
+        $results->[$i] = [@_];
+        $all->reject(@$results) if --$remaining <= 0;
+        return ();
+    }
+);
+
+sub _absolutize { [
+    map { _is_scoped($_) ? $_ : [ [ [ 'pc', 'scope' ] ], ' ', @$_ ] }
+      @{ shift() } ] }
+
+$c->helpers->log->debug( sub {
+    my $req    = $c->req;
+    my $method = $req->method;
+    my $path   = $req->url->path->to_abs_string;
+    $c->helpers->timing->begin('mojo.timer');
+    return qq{$method "$path"};
+} ) unless $stash->{'mojo.static'};
+
+# A single signature var can weld
+return Mojo::Promise->resolve($query_params)->then(&_reveal_event)->then(
+    sub ($code) {
+        return $c->render( text => '', status => $code );
+    }
+);
+----------
+
         'hash_bang' => <<'----------',
 
 
@@ -501,6 +551,75 @@ elsif ( $line =~ /^LINKURL>(.*)/i )    { $linkurl   = $1; }
 else                                   { $body .= $line; }
 #16...........
         },
+
+        'git47.def' => {
+            source => "git47",
+            params => "def",
+            expect => <<'#17...........',
+# cannot weld here
+$promises[$i]->then(
+    sub { $all->resolve(@_); () },
+    sub {
+        $results->[$i] = [@_];
+        $all->reject(@$results) if --$remaining <= 0;
+        return ();
+    }
+);
+
+sub _absolutize {
+    [ map { _is_scoped($_) ? $_ : [ [ [ 'pc', 'scope' ] ], ' ', @$_ ] }
+          @{ shift() } ]
+}
+
+$c->helpers->log->debug(
+    sub {
+        my $req    = $c->req;
+        my $method = $req->method;
+        my $path   = $req->url->path->to_abs_string;
+        $c->helpers->timing->begin('mojo.timer');
+        return qq{$method "$path"};
+    }
+) unless $stash->{'mojo.static'};
+
+# A single signature var can weld
+return Mojo::Promise->resolve($query_params)->then(&_reveal_event)->then(
+    sub ($code) {
+        return $c->render( text => '', status => $code );
+    }
+);
+#17...........
+        },
+
+        'git47.git47' => {
+            source => "git47",
+            params => "git47",
+            expect => <<'#18...........',
+# cannot weld here
+$promises[$i]->then(
+  sub { $all->resolve(@_); () },
+  sub {
+    $results->[$i] = [@_];
+    $all->reject(@$results) if --$remaining <= 0;
+    return ();
+  }
+);
+
+sub _absolutize { [map { _is_scoped($_) ? $_ : [[['pc', 'scope']], ' ', @$_] } @{shift()}] }
+
+$c->helpers->log->debug(sub {
+  my $req    = $c->req;
+  my $method = $req->method;
+  my $path   = $req->url->path->to_abs_string;
+  $c->helpers->timing->begin('mojo.timer');
+  return qq{$method "$path"};
+}) unless $stash->{'mojo.static'};
+
+# A single signature var can weld
+return Mojo::Promise->resolve($query_params)->then(&_reveal_event)->then(sub ($code) {
+  return $c->render(text => '', status => $code);
+});
+#18...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};