8 ### Test the basic sanity of the link-section treelet class
12 BEGIN { plan tests => 8 };
14 #use Pod::Simple::Debug (6);
18 use Pod::Simple::LinkSection;
19 use Pod::Simple::BlackBox; # for its pretty()
22 ['B', {'pie' => 'no'},
24 ['C', {'bzrok' => 'plip'},
30 my $treelet = Pod::Simple::LinkSection->new($bare_treelet);
32 # Make sure they're not the same
34 ok ref($bare_treelet), 'ARRAY';
35 ok ref($treelet), 'Pod::Simple::LinkSection';
37 print "# Testing stringification...\n";
39 ok $treelet->stringify, 'abc'; # explicit
40 ok join('', $treelet), 'abc'; # implicit
43 print "# Testing non-coreferentiality...\n";
45 my @stack = ($bare_treelet);
49 if(ref($this || '') eq 'ARRAY') {
50 push @stack, splice @$this;
51 push @$this, ("BAD!") x 3;
52 } elsif(ref($this || '') eq 'Pod::Simple::LinkSection') {
53 push @stack, splice @$this;
54 push @$this, ("BAD!") x 3;
55 } elsif(ref($this || '') eq 'HASH') {
59 # These will fail if $treelet and $bare_treelet are coreferential,
60 # since we just conspicuously nuked $bare_treelet
62 ok $treelet->stringify, 'abc'; # explicit
63 ok join('', $treelet), 'abc'; # implicit
67 print "# Byebye...\n";
69 print "# --- Done with ", __FILE__, " --- \n";