Просмотр исходного кода

Add non-regression tests for the case of empty dependency fields

Raphael Hertzog лет назад: 18
Родитель
Сommit
cb6376d061
3 измененных файлов с 17 добавлено и 4 удалено
  1. 6 0
      ChangeLog
  2. 3 1
      scripts/Makefile.am
  3. 8 3
      scripts/t/400_Dpkg_Deps.t

+ 6 - 0
ChangeLog

@@ -2,6 +2,12 @@
 
 	* scripts/Dpkg/Shlibs/Objdump.pm: Fix the checks in is_executable() and
 	is_public_library().
+	* scripts/t/200_Dpkg_Shlibs.t: Add some more tests to make sure
+	the above functions behave as expected.
+	* scripts/t/400_Dpkg_Deps.t: Add some more tests to make sure that
+	empty dependency fields are correctly handled.
+	* scripts/Makefile.am: Include the new data files required by the
+	tests above.
 
 2007-11-20  Guillem Jover  <guillem@debian.org>
 

+ 3 - 1
scripts/Makefile.am

@@ -64,7 +64,9 @@ EXTRA_DIST = \
 	t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf \
 	t/200_Dpkg_Shlibs/objdump.glib-ia64 \
 	t/200_Dpkg_Shlibs/objdump.libc6-2.3 \
-	t/200_Dpkg_Shlibs/objdump.libc6-2.6
+	t/200_Dpkg_Shlibs/objdump.libc6-2.6 \
+	t/200_Dpkg_Shlibs/objdump.dbd-pg \
+	t/200_Dpkg_Shlibs/objdump.ls
 
 CLEANFILES = \
 	$(bin_SCRIPTS) $(sbin_SCRIPTS) $(changelog_SCRIPTS) \

+ 8 - 3
scripts/t/400_Dpkg_Deps.t

@@ -1,16 +1,16 @@
 # -*- mode: cperl;-*-
 
-use Test::More tests => 12;
+use Test::More tests => 14;
 
 use strict;
 use warnings;
 
 use_ok('Dpkg::Deps');
 
-my $field_multiline = "libgtk2.0-common (= 2.10.13-1)  , libatk1.0-0 (>=
+my $field_multiline = " , , libgtk2.0-common (= 2.10.13-1)  , libatk1.0-0 (>=
 1.13.2), libc6 (>= 2.5-5), libcairo2 (>= 1.4.0), libcupsys2 (>= 1.2.7),
 libfontconfig1 (>= 2.4.0), libglib2.0-0  (  >= 2.12.9), libgnutls13 (>=
-1.6.3-0), libjpeg62, python (<< 2.5)";
+1.6.3-0), libjpeg62, python (<< 2.5) , , ";
 my $field_multiline_sorted = "libatk1.0-0 (>= 1.13.2), libc6 (>= 2.5-5), libcairo2 (>= 1.4.0), libcupsys2 (>= 1.2.7), libfontconfig1 (>= 2.4.0), libglib2.0-0 (>= 2.12.9), libgnutls13 (>= 1.6.3-0), libgtk2.0-common (= 2.10.13-1), libjpeg62, python (<< 2.5)";
 
 my $dep_multiline = Dpkg::Deps::parse($field_multiline);
@@ -53,4 +53,9 @@ my $dep_dup_union = Dpkg::Deps::parse($field_dup_union, union => 1);
 $dep_dup_union->simplify_deps($facts);
 is($dep_dup_union->dump(), "libc6 (>> 2.3), fake (<< 2.0), fake (>> 3.0), fake (= 2.5), python (<< 2.5)", "Simplify union deps");
 
+my $dep_empty1 = Dpkg::Deps::parse("");
+is($dep_empty1->dump(), "", "Empty dependency");
+
+my $dep_empty2 = Dpkg::Deps::parse(" , , ", union => 1);
+is($dep_empty2->dump(), "", "' , , ' is also an empty dependency");