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