use strict; use warnings; use Test::Base; use Moxy; sub _rewrite { Moxy::rewrite_html('http://localhost:9999/', shift, 'http://relative.example.jp/'); } sub remove_crlf { my $x = shift; $x =~ s/[\r\n]//g; $x; } filters { input => ['_rewrite', 'remove_crlf'], expected => ['chomp'], }; plan tests => 1*blocks; run_is input => 'expected'; __END__ === --- input bar --- expected bar === relative --- input bar --- expected bar === upper case tag --- input bar --- expected bar === --- input bar --- expected bar === no href. --- input bar --- expected bar === --- input
--- expected === relative --- input --- expected === relative img --- input
--- expected
=== abs img
--- input
--- expected
=== p img
--- input
foo
--- expectedfoo
=== mailto --- input bar --- expected bar === tel: --- input bar --- expected bar