Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
559b4108
Commit
559b4108
authored
Jan 18, 2019
by
Christophe Maudoux
🐛
Browse files
Fix unit test for Debian Buster
parent
e1565191
Changes
1
Hide whitespace changes
Inline
Side-by-side
lemonldap-ng-common/t/02-Common-Conf-File.t
View file @
559b4108
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment