]> git.donarmstrong.com Git - perltidy.git/commitdiff
add test case for file with just one character, '0'
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 6 Aug 2023 01:08:54 +0000 (18:08 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 6 Aug 2023 01:08:54 +0000 (18:08 -0700)
t/zero.t [new file with mode: 0644]

diff --git a/t/zero.t b/t/zero.t
new file mode 100644 (file)
index 0000000..b9d50d6
--- /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);