### ----------------------------------------------------
### -- Markdown::Grammar
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: t/04-Pod6.rakutest
### ----------------------------------------------------
use v6.d;
use Test;

use lib '.';
use lib './lib';

use Markdown::Grammar;

#===========================================================

plan 4;

#-----------------------------------------------------------
## 1
#-----------------------------------------------------------
# See: https://github.com/antononcube/Raku-Markdown-Grammar/issues/1
my $mtext1 = q:to/END/;
line1
END

my $res1 = q:to/END/;
=begin pod
=para
line1
=end pod
END

is from-markdown($mtext1, to => 'pod6'),
        $res1.trim-trailing,
        'Simple';

#-----------------------------------------------------------
## 2
#-----------------------------------------------------------
# See: https://github.com/antononcube/Raku-Markdown-Grammar/issues/2
my $mtext2 = q:to/END/;
```raku
my $obj = [12,]
```
END

my $res2 = q:to/END/;
=begin pod
=begin code :lang<raku>
my $obj = [12,]
=end code

=end pod
END

is from-markdown($mtext2, to => 'pod6'),
        $res2.trim-trailing,
        'Raku code block';

#-----------------------------------------------------------
## 3
#-----------------------------------------------------------
# See: https://github.com/antononcube/Raku-Markdown-Grammar/issues/4
my $mtext3 = q:to/END/;
```
{
    "name": "Anton"
}
```
END

my $res3 = q:to/END/;
=begin pod
=begin code
{
    "name": "Anton"
}
=end code

=end pod
END

is from-markdown($mtext3, to => 'pod6'),
        $res3.trim-trailing,
        'Raku code block with no lang spec';

#-----------------------------------------------------------
## 4
#-----------------------------------------------------------
# Same as the above using '~~~~~' as a fence
my $mtext4 = q:to/END/;
~~~~~
{
    "name": "Anton"
}
~~~~~
END

my $res4 = q:to/END/;
=begin pod
=begin code
{
    "name": "Anton"
}
=end code

=end pod
END

is from-markdown($mtext4, to => 'pod6'),
        $res3.trim-trailing,
        'Raku code block with no lang spec using "~~~~~" fence';

done-testing;


