18 print "hello world\n";
25 print "hello world\n";
29 my $teefile_expect = <<'EOM';
37 # Test capturing the .LOG, .DEBUG, .TEE outputs to strings.
38 # In this test we delete all comments and pod in the test script and send them
39 # to a .TEE file also save .DEBUG and .LOG output
40 my $params = "-dac -tac -D -g";
42 # Verify correctness of the formatted output and the .TEE output
43 # (.DEBUG and .LOG have been verified to work but are not checked here because
44 # they may change over time, making work for maintaining this test file)
53 my $err = Perl::Tidy::perltidy(
55 destination => \$output,
56 perltidyrc => \$params,
57 argv => '', # for safety; hide any ARGV from perltidy
58 stderr => \$stderr_string,
59 errorfile => \$errorfile_string, # not used when -se flag is set
61 debugfile => \$debugfile_string,
62 logfile => \$logfile_string,
65 if ( $err || $stderr_string || $errorfile_string ) {
67 print STDERR "This error received calling Perl::Tidy with '$sname'\n";
71 print STDERR "---------------------\n";
72 print STDERR "<<STDERR>>\n$stderr_string\n";
73 print STDERR "---------------------\n";
74 print STDERR "This error received calling Perl::Tidy with '$sname''\n";
75 ok( !$stderr_string );
77 if ($errorfile_string) {
78 print STDERR "---------------------\n";
79 print STDERR "<<.ERR file>>\n$errorfile_string\n";
80 print STDERR "---------------------\n";
81 print STDERR "This error received calling Perl::Tidy with '$sname''\n";
82 ok( !$errorfile_string );
86 ok( $output, $expect );
87 ok( $teefile, $teefile_expect );