File: section_insert.t

package info (click to toggle)
libapache-admin-config-perl 0.94-1.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, stretch, wheezy
  • size: 184 kB
  • ctags: 69
  • sloc: perl: 858; makefile: 3
file content (36 lines) | stat: -rw-r--r-- 777 bytes parent folder | download | duplicates (4)
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
use strict;
use Test;
plan test => 20;

use Apache::Admin::Config;
ok(1);

my $conf = new Apache::Admin::Config;
ok(defined $conf);

my $rv = $conf->add_section(test=>1, '-ontop');
ok(defined $rv);
ok($rv->name, 'test');
ok($rv->first_line, 1);

my $rv2 = $conf->add_section(test2=>2, '-ontop');
ok(defined $rv2);
ok($rv2->name, 'test2');
ok($rv2->first_line, 1);
ok($rv->first_line, 3);

my $rv3 = $conf->add_section(test3=>3, '-onbottom');
ok(defined $rv3);
ok($rv3->name, 'test3');
ok($rv3->first_line, 5);
ok($rv2->first_line, 1);
ok($rv->first_line, 3);


my $rv4 = $conf->add_section(test4=>4, -after=>$conf->section(test2=>2));
ok(defined $rv4);
ok($rv4->name, 'test4');
ok($rv4->first_line, 3);
ok($rv3->first_line, 7);
ok($rv2->first_line, 1);
ok($rv->first_line, 5);