From 1faa90225e178dba402902e59ede3b9f6b498cfa Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 5 Aug 2023 18:08:54 -0700 Subject: [PATCH] add test case for file with just one character, '0' --- t/zero.t | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 t/zero.t diff --git a/t/zero.t b/t/zero.t new file mode 100644 index 00000000..b9d50d60 --- /dev/null +++ b/t/zero.t @@ -0,0 +1,25 @@ +use strict; +use Test; +use Carp; +BEGIN {plan tests => 1} +use Perl::Tidy; + +#----------------------------------------------------------- +# test formatting a single character '0' with no line ending +#----------------------------------------------------------- +my $source = '0'; +my $perltidyrc = <<'EOM'; +-noadd-terminal-newline +EOM + +my $output; + +Perl::Tidy::perltidy( + source => \$source, + destination => \$output, + perltidyrc => \$perltidyrc, + argv => '', +); + +my $expected_output='0'; +ok($output, $expected_output); -- 2.39.5