### ----------------------------------------------------
### -- Arithmetic::PaperAndPencil
### -- Licenses: Artistic-2.0
### -- Authors: Jean Forget
### -- File: t/06-html.rakutest
### ----------------------------------------------------
# -*- encoding: utf-8; indent-tabs-mode: nil -*-
#
# Checking the generation of HTML
#
# The actions have no significance. They are just linked together to build a test case.
#
# Copyright 2023, 2024 Jean Forget
#
# This programme is free software; you can redistribute it and modify it under the Artistic License 2.0.

use Test;
use Arithmetic::PaperAndPencil;

plan 3;

my Arithmetic::PaperAndPencil $operation;

my $fname = 't/data/06-html.csv';
$operation .= new(csv => $fname);
my Str $ref = $fname.IO.slurp;
$ref ~~ s:g/\h//;
is($operation.csv, $ref, "there-and-back-again test for CSV");

my $html = $operation.html(lang => 'fr', silent => True, level => 0);
$ref = 't/data/06-html-fr-silent.html'.IO.slurp;
is($html, $ref, "generation of basic HTML");

my %css =  'underline' => 'under'
         , 'strike'    => 'striken'
         , 'write'     => 'writing'
         , 'read'      => 'reading'
         , 'talk'      => 'talking'
         ;
$html = $operation.html(lang => 'fr', silent => True, level => 0, css => %css);
$ref = 't/data/06-html-classy.html'.IO.slurp;
is($html, $ref, "generation of classy HTML");

done-testing;


