#
# KeyFile stuff.
#
use strict;
use Glib ':constants';
use Test::More tests => 7;

my $str = <<__EOK__
[mysection]
intkey=42
stringkey=hello
boolkey=true
[listsection]
intlist=1;1;2;3;5;8;13;
stringlist=Some;Values;In;A;List;
boollist=false;true;false
__EOK__
;

my $key_file = Glib::KeyFile->new;
isa_ok ($key_file, 'Glib::KeyFile');

ok ($key_file->load_from_data($str, [ qw(none) ]));

my @groups = $key_file->get_groups;
is (@groups, 2, 'we have two groups');

is ($key_file->get_start_group, 'mysection', 'start group');

is ($key_file->get_string($key_file->get_start_group, 'stringkey'), 'hello', 'howdy?');
is ($key_file->get_value('mysection', 'intkey'), 42, 'the answer');

my @integers = $key_file->get_integer_list('listsection', 'intlist');
is (@integers, 7, 'fibonacci would be proud');
