1 # Testing the LinkSection class
9 ### Test the basic sanity of the link-section treelet class
13 BEGIN { plan tests => 8 };
15 #use Pod::Simple::Debug (6);
19 use Pod::Simple::LinkSection;
20 use Pod::Simple::BlackBox; # for its pretty()
23 ['B', {'pie' => 'no'},
25 ['C', {'bzrok' => 'plip'},
31 my $treelet = Pod::Simple::LinkSection->new($bare_treelet);
33 # Make sure they're not the same
35 ok ref($bare_treelet), 'ARRAY';
36 ok ref($treelet), 'Pod::Simple::LinkSection';
38 print "# Testing stringification...\n";
40 ok $treelet->stringify, 'abc'; # explicit
41 ok join('', $treelet), 'abc'; # implicit
44 print "# Testing non-coreferentiality...\n";
46 my @stack = ($bare_treelet);
50 if(ref($this || '') eq 'ARRAY') {
51 push @stack, splice @$this;
52 push @$this, ("BAD!") x 3;
53 } elsif(ref($this || '') eq 'Pod::Simple::LinkSection') {
54 push @stack, splice @$this;
55 push @$this, ("BAD!") x 3;
56 } elsif(ref($this || '') eq 'HASH') {
60 # These will fail if $treelet and $bare_treelet are coreferential,
61 # since we just conspicuously nuked $bare_treelet
63 ok $treelet->stringify, 'abc'; # explicit
64 ok join('', $treelet), 'abc'; # implicit
68 print "# Byebye...\n";
70 print "# --- Done with ", __FILE__, " --- \n";