### ----------------------------------------------------
### -- Arithmetic::PaperAndPencil
### -- Licenses: Artistic-2.0
### -- Authors: Jean Forget
### -- File: t/06-mult.rakutest
### ----------------------------------------------------
# -*- encoding: utf-8; indent-tabs-mode: nil -*-
#
# Checking the generation of HTML on two examples of multiplications.
#
# In some actions, the level has been tweaked a little to display
# intermediate results that would not have been displayed normally.
#
# Copyright 2023, 2024 Jean Forget
#
# This programme is free software; you can redistribute it and modify it under the Artistic License 2.0.
#
# This test script has the same number as 06-html.rakutest, because it was created before 06-html.rakutest
# After I have begun coding the first steps of multiplication, I realised that it would be better if the
# html method was fully written and fully tested. So I created 06-html.rakutest and I did not bother
# to renumber 06-mult.rakutest.

use Test;
use Arithmetic::PaperAndPencil;

plan 5;

my Arithmetic::PaperAndPencil $operation;

my $fname = 't/data/06-mult.csv';
$operation .= new(csv => $fname);
my Str $ref = $fname.IO.slurp;
$ref ~~ s:g/\h//;
is($operation.csv, $ref);

my $html = $operation.html(lang => 'fr', silent => False, level => 0);
$ref = 't/data/06-mult-fr-talk.html'.IO.slurp;
is($html, $ref);

$html = $operation.html(lang => 'fr', silent => True, level => 0);
$ref = 't/data/06-mult-fr-silent.html'.IO.slurp;
is($html, $ref);

$html = $operation.html(lang => 'en', silent => False, level => 0);
$ref = 't/data/06-mult-en-talk.html'.IO.slurp;
is($html, $ref);

$html = $operation.html(lang => 'en', silent => True, level => 0);
$ref = 't/data/06-mult-en-silent.html'.IO.slurp;
is($html, $ref);


done-testing;


