lemonldap-ng-2.0.1-Remove_useless_test.patch 7.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
From 5752254af89729562f6459e45a6060a1ca4a6a9d Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 19:48:46 +0100
Subject: [PATCH 1/7] WIP - Fix unit test

---
 lemonldap-ng-common/t/02-Common-Conf-File.t | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index afa281ec7..dba925df0 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,6 +7,7 @@
 
 use strict;
 use Test::More;
+use v5.26.1;
 BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
 
 #########################
-- 
2.20.1


From baa2868d3f7444120460f0949c4e20d0429f4b4d Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 20:09:42 +0100
Subject: [PATCH 2/7] WIP - Fix unit test

---
 lemonldap-ng-common/t/02-Common-Conf-File.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index dba925df0..8c052c42c 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,7 +7,7 @@
 
 use strict;
 use Test::More;
-use v5.26.1;
+use v5.20;
 BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
 
 #########################
-- 
2.20.1


From adbe2adb3e2a8a7aada8cfffcea3a5f1fa20fea3 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:16:55 +0100
Subject: [PATCH 3/7] WIP - Fix unit test

---
 lemonldap-ng-common/t/02-Common-Conf-File.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 8c052c42c..8dcdf048f 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -49,8 +49,8 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
             open F, 'file t/lmConf-1.json |';
             $_ = join( '', <F> );
             close F;
-            ok( /(ascii|utf-?8)/si, "File is $1 encoded" )
-              or print STDERR "Result: $_\n";
+            ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
+            print STDERR "Result: $_\n";
             $count++;
         };
     }
-- 
2.20.1


From e1565191bf66f8bcd3dedc307a2972482e1fd402 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:38:24 +0100
Subject: [PATCH 4/7] WIP - Fix unit test

---
 lemonldap-ng-common/t/02-Common-Conf-File.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 8dcdf048f..2a09730cc 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -49,7 +49,7 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
             open F, 'file t/lmConf-1.json |';
             $_ = join( '', <F> );
             close F;
-            ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
+            ok( /(ascii|utf-?8|json\s?data)/si, "File is $1 encoded" );
             print STDERR "Result: $_\n";
             $count++;
         };
-- 
2.20.1


From 559b410849613731fff08fd58dae2f7aa40bbbe4 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:46:23 +0100
Subject: [PATCH 5/7] Fix unit test for Debian Buster

---
 lemonldap-ng-common/t/02-Common-Conf-File.t | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 2a09730cc..85d384198 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -17,10 +17,8 @@ BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
 
 my $h;
 
-ok(
-    $h = new Lemonldap::NG::Common::Conf(
-        {
-            type    => 'File',
+ok( $h = new Lemonldap::NG::Common::Conf(
+        {   type    => 'File',
             dirName => "t/",
         }
     ),
@@ -40,25 +38,27 @@ my @test = (
     { cfgNum => 1, test => 'éà' }
 );
 
-for ( my $i = 0 ; $i < @test ; $i++ ) {
+for ( my $i = 0; $i < @test; $i++ ) {
     ok( $h->store( $test[$i] ) == 1, "Test $i is stored" )
-      or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
+        or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
     $count++;
     if ( -x '/usr/bin/file' ) {
         eval {
             open F, 'file t/lmConf-1.json |';
             $_ = join( '', <F> );
             close F;
-            ok( /(ascii|utf-?8|json\s?data)/si, "File is $1 encoded" );
-            print STDERR "Result: $_\n";
+
+            ## Debian Buster 'file' command returns JSON DATA
+            ok( /(ascii|utf-?8|json\sdata)/si, "File is $1 encoded" )
+                or print STDERR "Result: $_\n";
             $count++;
         };
     }
     my $cfg;
     ok( $cfg = $h->load(1), "Test $i can be read" )
-      or print STDERR $Lemonldap::NG::Common::Conf::msg;
+        or print STDERR $Lemonldap::NG::Common::Conf::msg;
     ok( $cfg->{test} eq $test[$i]->{test}, "Test $i is restored" )
-      or print STDERR "Expect $cfg->{test} eq $test[$i]->{test}\n";
+        or print STDERR "Expect $cfg->{test} eq $test[$i]->{test}\n";
     $count += 2;
 }
 
-- 
2.20.1


From 6dee2f2dba53e3261ceed76bc0bd7999096e3e76 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:47:40 +0100
Subject: [PATCH 6/7] Fix unit test for Debian Buster

---
 lemonldap-ng-common/t/02-Common-Conf-File.t | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 85d384198..63cadffcf 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,7 +7,6 @@
 
 use strict;
 use Test::More;
-use v5.20;
 BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
 
 #########################
-- 
2.20.1


From 774137e5fd85d3c1cdeca842e28e4687f14dc670 Mon Sep 17 00:00:00 2001
From: Xavier Guimard <yadd@debian.org>
Date: Sat, 19 Jan 2019 09:46:55 +0100
Subject: [PATCH 7/7] Remove useless test (fixes test failure on Debian
 unstable)

---
 lemonldap-ng-common/t/02-Common-Conf-File.t | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 63cadffcf..ebd5f5b38 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -41,18 +41,6 @@ for ( my $i = 0; $i < @test; $i++ ) {
     ok( $h->store( $test[$i] ) == 1, "Test $i is stored" )
         or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
     $count++;
-    if ( -x '/usr/bin/file' ) {
-        eval {
-            open F, 'file t/lmConf-1.json |';
-            $_ = join( '', <F> );
-            close F;
-
-            ## Debian Buster 'file' command returns JSON DATA
-            ok( /(ascii|utf-?8|json\sdata)/si, "File is $1 encoded" )
-                or print STDERR "Result: $_\n";
-            $count++;
-        };
-    }
     my $cfg;
     ok( $cfg = $h->load(1), "Test $i can be read" )
         or print STDERR $Lemonldap::NG::Common::Conf::msg;
-- 
2.20.1