4 BEGIN {plan tests => 1}
7 #----------------------------------------------------------------------
11 # passing perltidyrc (we cannot allow local .perltidyrc flags to be used)
13 #----------------------------------------------------------------------
14 my $source = "lextest";
15 my $perltidyrc = <<'EOM';
23 destination => \@tidy_output,
24 perltidyrc => \$perltidyrc,
28 my @expected_output=<DATA>;
30 if (@expected_output == @tidy_output) {
31 while ( $_ = pop @tidy_output ) {
32 my $expect = pop @expected_output;
33 if ( $expect ne $_ ) {
34 print STDERR "got:$_";
36 print STDERR "expected_output:$expect";
43 print STDERR "Line Counts differ\n";
48 # This is the expected result of 'perltidy -gnu lextest':
51 # This is a simple testfile to demonstrate perltidy, from perlop(1).
52 # One way (of several) to run perltidy is as follows:
54 # perl ./perltidy lextest
56 # The output will be "lextest.tdy"
58 $url = new URI::URL "http://www/"; die if $url eq "xXx";
62 print(" digits"), redo LOOP if /\G\d+\b[,.;]?\s*/gc;
63 print(" lowercase"), redo LOOP if /\G[a-z]+\b[,.;]?\s*/gc;
64 print(" UPPERCASE"), redo LOOP if /\G[A-Z]+\b[,.;]?\s*/gc;
65 print(" Capitalized"), redo LOOP if /\G[A-Z][a-z]+\b[,.;]?\s*/gc;
66 print(" MiXeD"), redo LOOP if /\G[A-Za-z]+\b[,.;]?\s*/gc;
67 print(" alphanumeric"), redo LOOP if /\G[A-Za-z0-9]+\b[,.;]?\s*/gc;
68 print(" line-noise"), redo LOOP if /\G[^A-Za-z0-9]+/gc;
69 print ". That's all!\n";