#!/usr/bin/env perl use strict; use warnings; use HTML::RewriteAttributes; use Test::More tests => 2; my $html = << "END";

hooray

END my @seen; my $rewrote = HTML::RewriteAttributes->rewrite($html, sub { my ($tag, $attr, $value) = @_; push @seen, [$tag, $attr, $value]; return uc $value; }); is_deeply(\@seen, [ [img => src => "moose.jpg"], [img => src => "http://example.com/nethack.png"], [p => align => "justified"], [p => style => "color: red"], ]); is($rewrote, << "END", "rewrote the html correctly");

hooray

END