3
# This script attempts to reproduce:
4
# https://rt.cpan.org/Ticket/Display.html?id=30402
6
# #30402: WriteConfig does not write the last lines of a file if they are comments
8
use Test::More tests => 1;
18
my $conf = Config::IniFiles->new(
19
-file => File::Spec->catfile(File::Spec->curdir(), 't', 'trailing-comments.ini')
22
my $new_file = File::Spec->catfile(
23
File::Spec->curdir(), 't', 'new-trail.ini'
26
$conf->WriteConfig($new_file);
31
open my $fh, "<", $new_file;
39
qr{; End Comment 1\n; End Comment 2\n+\z}ms,
40
"WriteConfig() Preserved end comments."
43
# Remove the generated files so they won't pollute the filesystem /