Conf-Libconfig

 view release on metacpan or  search on metacpan

t/11-booltest.t  view on Meta::CPAN


my $cfg1 = 't/1_foo.cfg';
my $cfg2 = 't/2_foo.cfg';
my %fooplc = ();

my $foo = new Conf::Libconfig;
my $specfoo = new Conf::Libconfig;

ok($foo->new(), 'new - status ok');
ok($foo->add_hash('', 'plc', \%fooplc), 'add hash - status ok');
ok($foo->add_boolscalar('plc', 'transparent', 0), 'add bool scalar - status ok');
ok($foo->add_boolscalar('plc', 'polling', 1), 'add bool scalar - status ok');
ok($foo->write_file($cfg1), 'write file - status ok');

# Check hash method
cmp_deeply(
	my $fooref = $foo->fetch_hashref("plc"),
	{
		'polling' => 1,
		'transparent' => 0
	},
	"fetch scalar into hash reference - status ok",
);

ok($specfoo->new(), 'new - status ok');
ok($specfoo->getversion(), 'getversion - status ok');
my $libconfig_version = $specfoo->getversion();
if ($libconfig_version > 1.4) {
	ok($specfoo->read_string("new:{key = \"value\";};"), 'read string - status ok');
} else {



( run in 0.399 second using v1.01-cache-2.11-cpan-0a6323c29d9 )