[libconfig-model-dpkg-perl] 03/05: added test for Scanner::__pack_files
dod at debian.org
dod at debian.org
Wed Jan 14 20:07:14 UTC 2015
This is an automated email from the git hooks/post-receive script.
dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.
commit 964da6bf6c4ced714625fafae3097e39471a25a3
Author: Dominique Dumont <dod at debian.org>
Date: Wed Jan 14 21:04:27 2015 +0100
added test for Scanner::__pack_files
---
t/scanner/pack_files.t | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/t/scanner/pack_files.t b/t/scanner/pack_files.t
new file mode 100644
index 0000000..7866ccc
--- /dev/null
+++ b/t/scanner/pack_files.t
@@ -0,0 +1,93 @@
+# -*- cperl -*-
+use strict;
+use warnings;
+use 5.010;
+
+use Test::More; # see done_testing()
+use Test::Differences;
+use YAML::Tiny;
+
+require_ok( 'Dpkg::Copyright::Scanner' );
+
+my @tests = (
+ [
+ 'dir with one file',
+ "---
+data-impl:
+ defgroup.h: 1
+",
+ [['1', 'data-impl/defgroup.h']] ,
+ ],
+ [
+ 'dir with several files',
+ "---
+data:
+ cert-store.cc: 5
+ cert-store.h: 5
+ defgroup.h: 1
+ parts.cc: 3
+ parts.h: 3
+",
+ [
+ [ 5, 'data/cert-store.cc', 'data/cert-store.h'],
+ [ 1, 'data/defgroup.h'],
+ [ 3, 'data/parts.cc', 'data/parts.h']
+ ]
+ ],
+ [
+ 'dir with subdirs',
+ "
+---
+'*': 0
+pan:
+ '*': 4
+ data:
+ cert-store.cc: 5
+ cert-store.h: 5
+ defgroup.h: 1
+ parts.cc: 3
+ parts.h: 3
+ data-impl:
+ defgroup.h: 1
+ general:
+ debug.cc: 1
+ defgroup.h: 1
+ e-util.cc: 8
+ e-util.h: 8
+ gui:
+ action-manager.h: 1
+ defgroup.h: 1
+ e-action-combo-box.c: 18
+ e-action-combo-box.h: 18
+ e-charset-combo-box.c: 17
+ e-charset-combo-box.h: 17
+ icons:
+ '*': 4
+",
+ [
+ [ 0,'*' ],
+ [ 4,'pan/*' ],
+ [ 5,'pan/data/cert-store.cc','pan/data/cert-store.h' ],
+ [ 1,'pan/data/defgroup.h' ],
+ [ 3,'pan/data/parts.cc','pan/data/parts.h' ],
+ [ 1,'pan/data-impl/defgroup.h' ],
+ [ 1,'pan/general/debug.cc','pan/general/defgroup.h' ],
+ [ 8,'pan/general/e-util.cc','pan/general/e-util.h' ],
+ [ 1,'pan/gui/action-manager.h','pan/gui/defgroup.h' ],
+ [ 18,'pan/gui/e-action-combo-box.c','pan/gui/e-action-combo-box.h' ],
+ [ 17,'pan/gui/e-charset-combo-box.c','pan/gui/e-charset-combo-box.h'],
+ [ 4,'pan/icons/*' ],
+ ]
+ ],
+
+);
+
+foreach my $t (@tests) {
+ my ($label,$in,$expect) = @$t;
+ my @res ;
+ Dpkg::Copyright::Scanner::__pack_files(Load($in),\@res);
+ eq_or_diff(\@res,$expect,"__pack_files $label");
+}
+
+
+done_testing();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git
More information about the Pkg-perl-cvs-commits
mailing list