### ----------------------------------------------------
### -- Rakuast::RakuDoc::Render
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth
### -- File: xt/100-warnings.rakutest
### ----------------------------------------------------
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 Q<to be said>inside letters.
    =end rakudoc
    QAST
$rv = $rdp.render( $ast, :pre-finalised );
like $rv.body, /
    'Some thing ' .+
    'Q<to be said>' .+
    'inside letters.'
    /, 'Q-markup not rendered';
like $rv.warnings[0], / '｢Q｣' .+ 'is reserved for future' /, 'warning generated';

done-testing;


