3 |
use Libconf qw(:functions); |
use Libconf qw(:functions); |
4 |
use Data::Dumper; |
use Data::Dumper; |
5 |
|
|
6 |
|
my $struct; |
7 |
# test 1, minimal requirement : regenerate correctly |
# test 1, minimal requirement : regenerate correctly |
8 |
display(1); |
display(1); |
9 |
my $struct = new Libconf("XF86Config", 'XF86Config', ''); |
$struct = new Libconf("XF86Config", 'XF86Config', ''); |
10 |
#print Data::Dumper->Dump([$struct],['struct']) . "\n"; |
#print Data::Dumper->Dump([$struct],['struct']) . "\n"; |
11 |
$struct->writeConf("xf86config_output_1"); |
$struct->writeConf("xf86config_output_1"); |
12 |
test(1); |
test(1); |
19 |
$struct->writeConf("xf86config_output_2"); |
$struct->writeConf("xf86config_output_2"); |
20 |
test(2); |
test(2); |
21 |
|
|
22 |
# test 2, editing an atom |
# test 3, editing an atom |
23 |
display(3); |
display(3); |
24 |
$struct = new Libconf("XF86Config", 'XF86Config', ''); |
$struct = new Libconf("XF86Config", 'XF86Config', ''); |
25 |
$struct->editAtom(-1, { |
$struct->editAtom(-1, { |
26 |
'value' => '"Matrox Millennium G450 1 TESTING"', |
type => 'KEY_VALUE', |
27 |
'type' => 'KEY_VALUE', |
sections => [ |
|
'sections' => [ |
|
28 |
{ |
{ |
29 |
'name' => 'Device' |
'name' => 'Device' |
30 |
} |
} |
31 |
], |
], |
32 |
'key' => 'Identifier' |
key => 'Identifier', |
33 |
|
value => '"Matrox Millennium G450 1 TESTING"', |
34 |
}, |
}, |
35 |
); |
); |
36 |
$struct->writeConf("xf86config_output_3"); |
$struct->writeConf("xf86config_output_3"); |