[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 03/08: t: Make DepMap tests resistent to hash order changes



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit d7ab18ccd5d315580af01a160a388a38a6158c3b
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Aug 25 18:06:34 2013 +0200

    t: Make DepMap tests resistent to hash order changes
    
    Sort the return value of selectable, so the test is immune to
    iteration order of hashes.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 t/scripts/Lintian/DepMap/05multi-add.t  |   10 +++++++---
 t/scripts/Lintian/DepMap/08initialise.t |    2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/t/scripts/Lintian/DepMap/05multi-add.t b/t/scripts/Lintian/DepMap/05multi-add.t
index fffe253..3d2c043 100644
--- a/t/scripts/Lintian/DepMap/05multi-add.t
+++ b/t/scripts/Lintian/DepMap/05multi-add.t
@@ -16,13 +16,17 @@ $map->add('D', 'A');
 $map->add('D', 'B', 'C');
 
 is_deeply(
-    [$map->selectable],
-    ['A', 'C', 'B'],
+    [sort($map->selectable)],
+    ['A', 'B', 'C'],
     'D has dependencies, not selectable'
 );
 
 $map->satisfy('A');
-is_deeply([$map->selectable()], ['C', 'B'], 'A satisfied, B and C selectable');
+is_deeply(
+    [sort($map->selectable)],
+    ['B', 'C'],
+    'A satisfied, B and C selectable'
+);
 
 $map->satisfy('B');
 is_deeply([$map->selectable()], ['C'], 'B satisfied, C selectable');
diff --git a/t/scripts/Lintian/DepMap/08initialise.t b/t/scripts/Lintian/DepMap/08initialise.t
index 93e6ff2..8d5b884 100644
--- a/t/scripts/Lintian/DepMap/08initialise.t
+++ b/t/scripts/Lintian/DepMap/08initialise.t
@@ -24,7 +24,7 @@ is(join(', ', $obj->selectable),
 $obj->add('B');
 $obj->satisfy('B');
 $obj->initialise();
-is(join(', ', $obj->selectable),
+is(join(', ', sort($obj->selectable)),
     'A, B','A and B are selectable once again after being satisfied');
 
 $obj->add('B', 'A');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: