X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=t%2Fsnippets17.t;h=033da5f9b17710b1c642118a154f085cbcabdb88;hb=880633cc084e9d787eb9f760d3851c5d660db17c;hp=e726bd4d086d533da5ff97c099c5df719e7c13c9;hpb=57d829ae0e2c75828f8ecc9c7139579350927dbc;p=perltidy.git diff --git a/t/snippets17.t b/t/snippets17.t index e726bd4..033da5f 100644 --- a/t/snippets17.t +++ b/t/snippets17.t @@ -76,10 +76,27 @@ BEGIN { $rsources = { 'align32' => <<'----------', -# should not get alignment here: +# align just the last two lines my $c_sub_khwnd = WindowFromId $k_hwnd, 0x8008; # FID_CLIENT ok $c_sub_khwnd, 'have kids client window'; ok IsWindow($c_sub_khwnd), 'IsWindow works on the client'; + +# parenless calls +mkTextConfig $c, $x, $y, -anchor => 'se', $color; +mkTextConfig $c, $x + 30, $y, -anchor => 's', $color; +mkTextConfig $c, $x + 60, $y, -anchor => 'sw', $color; +mkTextConfig $c, $x, $y + 30, -anchor => 'e', $color; + +permute_test [ 'a', 'b', 'c' ], '/', '/', [ 'a', 'b', 'c' ]; +permute_test [ 'a,', 'b', 'c,' ], '/', '/', [ 'a,', 'b', 'c,' ]; +permute_test [ 'a', ',', '#', 'c' ], '/', '/', [ 'a', ',', '#', 'c' ]; +permute_test [ 'f_oo', 'b_ar' ], '/', '/', [ 'f_oo', 'b_ar' ]; + +# issue c093 - broken sub, but align fat commas +use constant UNDEF_ONLY => sub { not defined $_[0] }; +use constant EMPTY_OR_UNDEF => sub { + !@_ or @_ == 1 && !defined $_[0]; +}; ---------- 'bos' => <<'----------', @@ -314,10 +331,27 @@ sub plugh () : Ugly('\(") : Bad; source => "align32", params => "def", expect => <<'#1...........', -# should not get alignment here: +# align just the last two lines my $c_sub_khwnd = WindowFromId $k_hwnd, 0x8008; # FID_CLIENT -ok $c_sub_khwnd, 'have kids client window'; +ok $c_sub_khwnd, 'have kids client window'; ok IsWindow($c_sub_khwnd), 'IsWindow works on the client'; + +# parenless calls +mkTextConfig $c, $x, $y, -anchor => 'se', $color; +mkTextConfig $c, $x + 30, $y, -anchor => 's', $color; +mkTextConfig $c, $x + 60, $y, -anchor => 'sw', $color; +mkTextConfig $c, $x, $y + 30, -anchor => 'e', $color; + +permute_test [ 'a', 'b', 'c' ], '/', '/', [ 'a', 'b', 'c' ]; +permute_test [ 'a,', 'b', 'c,' ], '/', '/', [ 'a,', 'b', 'c,' ]; +permute_test [ 'a', ',', '#', 'c' ], '/', '/', [ 'a', ',', '#', 'c' ]; +permute_test [ 'f_oo', 'b_ar' ], '/', '/', [ 'f_oo', 'b_ar' ]; + +# issue c093 - broken sub, but align fat commas +use constant UNDEF_ONLY => sub { not defined $_[0] }; +use constant EMPTY_OR_UNDEF => sub { + !@_ or @_ == 1 && !defined $_[0]; +}; #1........... },