From 0471e0015eae2f28b26bafc700819744c397600d Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 25 Apr 2013 04:16:25 +1200 Subject: [PATCH] Bug 10112 - add test for ./debian/control file to test, apply patch... - run successful test $ perl ./t/00-valid-debian-control-file.t 1..1 ok 1 - parsed ./debian/control file ok - add bad string to ./debian/control file $ sed -i -e '20i -------\' ./debian/control - run failed test $ perl ./t/00-valid-debian-control-file.t 1..1 not ok 1 - parsed ./debian/control file ok Signed-off-by: Mirko Tietgen --- t/00-valid-debian-control-file.t | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) create mode 100644 t/00-valid-debian-control-file.t diff --git a/t/00-valid-debian-control-file.t b/t/00-valid-debian-control-file.t new file mode 100644 index 0000000..f50f381 --- /dev/null +++ b/t/00-valid-debian-control-file.t @@ -0,0 +1,22 @@ +use Modern::Perl; +use Parse::DebControl; +use Test::More; + +plan tests => 1; + +my $parser = new Parse::DebControl; + +$parser->DEBUG(); + +my %opt = ( 'stripComments' => 1, ); + +my $rc; +eval { + + local $SIG{__WARN__} = sub { }; # perls arcane syntax to shush stderr?! + $rc = $parser->parse_file( './debian/control', \%opt ); +}; + +isnt( $rc, undef, "parsed ./debian/control file ok" ); + +1; -- 1.7.2.5