#!/usr/bin/env perl
my
$table
= Algorithm::Diff::HTMLTable->new;
{
my
$row
=
$table
->_add_tablerow(
line_nr_a
=> 20,
line_nr_b
=> 19,
);
my
$check
=
q~
<tr style="border: 1px solid">
<td style="background-color: gray">20</td>
<td ></td>
<td style="background-color: gray">19</td>
<td ></td>
</tr>
~
;
is_string
$row
,
$check
;
}
{
my
$row
=
$table
->_add_tablerow(
line_nr_a
=> 20,
line_a
=>
'This is a T"est'
,
line_nr_b
=> 19,
);
my
$check
=
q~
<tr style="border: 1px solid">
<td style="background-color: gray">20</td>
<td >This is a T"est</td>
<td style="background-color: gray">19</td>
<td ></td>
</tr>
~
;
is_string
$row
,
$check
;
}
{
my
$row
=
$table
->_add_tablerow(
line_nr_a
=> 20,
line_a
=>
'This is a T"est'
,
line_b
=>
'This is a T"est'
,
line_nr_b
=> 19,
);
my
$check
=
q~
<tr style="border: 1px solid">
<td style="background-color: gray">20</td>
<td >This is a T"est</td>
<td style="background-color: gray">19</td>
<td >This is a T"est</td>
</tr>
~
;
is_string
$row
,
$check
;
}
{
my
$row
=
$table
->_add_tablerow(
line_nr_a
=> 20,
line_b
=>
'This is a T"est'
,
line_nr_b
=> 19,
);
my
$check
=
q~
<tr style="border: 1px solid">
<td style="background-color: gray">20</td>
<td ></td>
<td style="background-color: gray">19</td>
<td >This is a T"est</td>
</tr>
~
;
is_string
$row
,
$check
;
}
{
my
$row
=
$table
->_add_tablerow(
line_nr_a
=> 20,
line_b
=>
'This is a T"est'
,
color_b
=>
'green'
,
line_nr_b
=> 19,
);
my
$check
=
q~
<tr style="border: 1px solid">
<td style="background-color: gray">20</td>
<td ></td>
<td style="background-color: gray">19</td>
<td style="color: green;">This is a T"est</td>
</tr>
~
;
is_string
$row
,
$check
;
}
done_testing();