### ----------------------------------------------------
### -- Cro::WebApp
### -- Licenses: Artistic-2.0
### -- Authors: Jonathan Worthington <jnthn@jnthn.net>
### -- File: t/library.rakutest
### ----------------------------------------------------
use Cro::WebApp::Template;
use Test;
use lib $*PROGRAM.parent.add('library-module').Str;

my constant $base = $*PROGRAM.parent.add('library-test-data');


is render-template($base.add('use-only.crotmp'), {}), q:to/EXPECTED/, 'Use of a library compiles';

    Everything is OK
    EXPECTED

is render-template($base.add('call-sub.crotmp'), {}), q:to/EXPECTED/, 'Can call a library subroutine';

    Library: hell and damnation
    EXPECTED

is render-template($base.add('call-macro.crotmp'), {}), q:to/EXPECTED/, 'Can call a library macro';

    <div class="container">Contained</div>
    EXPECTED

is render-template($base.add('call-fragment.crotmp'), {a => 'hell', b=> 'dunkel'}), q:to/EXPECTED/, 'Can call a library fragment';

    Fragment: hell and dunkel
    EXPECTED

done-testing;


