### ----------------------------------------------------
### -- Rakuast::RakuDoc::Render
### -- Licenses: Artistic-2.0
### -- Authors: Richard Hainsworth
### -- File: xt/095-footnotes.rakutest
### ----------------------------------------------------
use v6.d;
use Test;
use RakuDoc::Render;

plan 5;

my $ast;
my $rv;
my RakuDoc::Processor $rdp .= new(:test );
$ast = Q:to/QAST/.AST;
    =begin rakudoc
    Some thingN<to be said>inside letters.
    =end rakudoc
    QAST
$rv = $rdp.render( $ast, :pre-finalised );
like $rv.body, /
    'Some thing'
    '<markup-N>' .*?
    'fnNumber' .*? '｢1｣' .*?
    'fnTarget:' .+
    'retTarget:' .+
    '</markup-N>' .*?
    'inside letters.'
    /, 'N-markup puts note in text';
is $rv.footnotes.elems, 1, 'One footnote';
is $rv.footnotes[0].elems, 4, 'N-markup makes a 4 element footnote';
is $rv.footnotes[0]<contents>, 'to be said', 'N-markup puts text in element of footnote';
is $rv.footnotes[0]<fnNumber>, 1, 'N-markup number is same as in text';

done-testing;


