#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 8;
use Test::Builder::Tester;
use Test::DoubleEncodedEntities;
test_out("ok 1 - foo");
ok_dee('<html><body>é fish</body></html>', "foo");
test_test("normal");
test_out("ok 1 - foo");
ok_dee('<html><body><a href="&eacute;">foo</a></body></html>', "foo");
test_test("attr");
test_out("not ok 1 - foo");
test_fail(+2);
test_diag(qq{Found 1 "&eacute;"});
ok_dee('<html><body>&eacute; fish</body></html>', "foo");
test_test("1 ent");
test_out("not ok 1 - foo");
test_fail(+3);
test_diag(qq{Found 2 "&Eacute;"});
test_diag(qq{Found 1 "&eacute;"});
ok_dee('<html><body>fish &Eacute;
&Eacute;&eacute;</body></html>', "foo");
test_test("many ent");
test_out("not ok 1 - foo");
test_fail(+2);
test_diag(qq{Found 1 "&#233;"});
ok_dee('<html><body>&#233;</body></html>', "foo");
test_test("numerical");
test_out("not ok 1 - foo");
test_fail(+2);
test_diag(qq{Found 1 "&#233;"});
ok_dee('<html><body>&#233;</body></html>', "foo");
test_test("double numerical");
test_out("not ok 1 - foo");
test_fail(+2);
test_diag(qq{Found 1 "&#233;"});
ok_dee('<html><body>&#233;</body></html>', "foo");
test_test("double numerical with extra zero");
test_out("not ok 1 - foo");
test_fail(+2);
test_diag(qq{Found 1 "&#233;"});
ok_dee('<html><body>&#233;</body></html>', "foo");
test_test("double numerical with many extra zeroes");