From cb6376d061d17c5762552a26a9385bc283ae246d Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Wed, 21 Nov 2007 12:09:42 +0100 Subject: [PATCH] Add non-regression tests for the case of empty dependency fields --- ChangeLog | 6 ++++++ scripts/Makefile.am | 4 +++- scripts/t/400_Dpkg_Deps.t | 11 ++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index caaab771..8ec8c254 100644 --- a/ChangeLog +++ b/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 diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 538ac587..1e161a07 100644 --- a/scripts/Makefile.am +++ b/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) \ diff --git a/scripts/t/400_Dpkg_Deps.t b/scripts/t/400_Dpkg_Deps.t index 82565aef..47517542 100644 --- a/scripts/t/400_Dpkg_Deps.t +++ b/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"); -- 2.39.5