use Test;
plan 7;

use lib $*PROGRAM.parent.add('lib');
use HtmlHighlight;

my $data-dir = $*PROGRAM.parent.add('test-data');

my @test-files = <
    comment
    rakudoc
    regex
    string
    code
    calls
    bugs
>;

for @test-files -> $file {
    my $input-file = $data-dir.add: $file ~ '.rakumod';
    my $expect-file = $data-dir.add: $file ~ '.html';
    my $generated = HtmlHighlight::make-html($input-file.IO.slurp, $input-file.basename);
    my $expected = $expect-file.slurp;
#    $expect-file.spurt: $generated;
    ok $generated eq $expected, "$file (Compare $expect-file to `raku t/bin/html-highlight.raku $input-file out.html`.)";
}
