#!/usr/bin/env perl use strict; use warnings; use HTML::RewriteAttributes::Resources; use Test::More tests => 2; my $html = << "END";
Example
hooray
END my @seen; my $rewrote = HTML::RewriteAttributes::Resources->rewrite($html, sub { my $uri = shift; my %args = @_; push @seen, [$uri, $args{tag}, $args{attr}]; return reverse $uri; }); is_deeply(\@seen, [ ["moose.jpg" => img => "src"], ["http://example.com/nethack.png" => img => "src"], ]); is($rewrote, << "END", "rewrote the html correctly");hooray
END