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

Dpkg::Deps: Add test cases for deps_concat()

Guillem Jover лет назад: 12
Родитель
Сommit
b253ce5a1c
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      scripts/t/Dpkg_Deps.t

+ 8 - 1
scripts/t/Dpkg_Deps.t

@@ -16,11 +16,18 @@
 use strict;
 use strict;
 use warnings;
 use warnings;
 
 
-use Test::More tests => 26;
+use Test::More tests => 31;
 use Dpkg::Arch qw(get_host_arch);
 use Dpkg::Arch qw(get_host_arch);
 
 
 use_ok('Dpkg::Deps');
 use_ok('Dpkg::Deps');
 
 
+is(deps_concat(), '', 'Concatenate an empty list');
+is(deps_concat(undef), '', 'Concatenate list with undef');
+is(deps_concat(''), '', 'Concatenate an empty string');
+is(deps_concat('', undef), '', 'Concatenate empty string with undef');
+is(deps_concat('dep-a', undef, 'dep-b'), 'dep-a, dep-b',
+   'Concatenate two strings with intermixed undef');
+
 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),
 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 (>=
 libfontconfig1 (>= 2.4.0), libglib2.0-0  (  >= 2.12.9), libgnutls13 (>=