use v6.d;
use Test;
use RakuDoc::Render;

plan 4;

my $ast;
my $rv;
my RakuDoc::Processor $rdp .= new(:test);
$ast = Q:to/QAST/.AST;
    =begin rakudoc
    =head1 Item testing

    Some text
    =nonitem first item should be level 1
    =item second item L1
    =item third item L1
    =end rakudoc
    QAST
$rv = $rdp.render( $ast, :final-wrap );
like $rv, / '<unknown>' .+ 'contents' .+ 'nonitem' .+ '</unknown>' /, 'minimal render of unknown';
like $rv, / '<warnings>' .+ 'not a valid builtin' .+ '</warnings>'  /,'warning list';

$ast = Q:to/QAST/.AST;
    =begin rakudoc
    Some thing G<to be said>inside letters.
    =end rakudoc
    QAST
$rv = $rdp.render( $ast, :pre-finalised );
like $rv.body, /
    'Some thing ' .+
    'G<to be said>' .+
    'inside letters.'
    /, 'G-markup not rendered';
like $rv.warnings[0], / '｢G｣' .+ 'is reserved for future' /, 'warning generated';

done-testing;
