### ----------------------------------------------------
### -- Raku::Pod::Render
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth
### -- File: xt/901-html/95-declarators.rakutest
### ----------------------------------------------------
use Test;
use Pod::To::HTML2;
my $rv;
my $def-dir = 'xt/test-def'.IO;
my $tar-dir = 'xt/tar-dir'.IO;

bail-out "Requires $def-dir and $tar-dir" unless ($def-dir ~~ :e and $tar-dir ~~ :e);
chdir ~$tar-dir;

my $processor = Pod::To::HTML2.new(:$def-dir, :plugins() );
my $pc = 0;

#plan 4;
plan 2;

##| This is a variable
#my $variable;
#
#todo 'to be implemented ';
#$rv = $processor.render-block($=pod[$pc++]);
#like $rv, /
#    '<article>'
#    '<code class=\"pod-code-inline\">my $variable</code>'
#    'This is a variable'
#    '</article>'
#    /, 'variable top comment ok';
#
#my $under-variable;
##= Some under content
#
#todo 'to be implemented';
#$rv = $processor.render-block($=pod[$pc++]);
#like $rv, /
#'thing'
#/, 'under comment ok';

#| Here is a subroutine with a signature
sub a-nice-sub(Str $fish, :$fingers = 'real potato' ) { my $y = 2; }

$rv = $processor.render-block($=pod[$pc++]);

like $rv, /
    '<article>'
    '<code class="pod-code-inline">sub a-nice-sub (Str $fish, :$fingers = "real potato") </code>'
    'Here is a subroutine with a signature'
    '</article>'
/, 'sub comment ok';

#| This is a proto
proto sub flamingo( $one, $two, $three ) {*}

$rv = $processor.render-block($=pod[$pc++]);
like $rv, /
    '<article>'
    '<code class="pod-code-inline">proto sub flamingo ($one, $two, $three) </code>'
    'This is a proto'
    '</article>'
/, 'proto comment ok';

done-testing;


