X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=blobdiff_plain;f=t%2Fdwim-autoload.t;fp=t%2Fdwim-autoload.t;h=2fc73de7110627a115a9865e8350acdef69c45a9;hp=12a64802ba11e99615f07b6634b559b951522109;hb=c160b40ddbd9806f3db869e6076bb46019b293f3;hpb=bce7b3519da39ab703e46aa27e9a5b1a1791279a diff --git a/t/dwim-autoload.t b/t/dwim-autoload.t index 12a6480..2fc73de 100644 --- a/t/dwim-autoload.t +++ b/t/dwim-autoload.t @@ -312,7 +312,7 @@ sub code_stream (&) { 'li.bar' => ['bar'], })->to_html; is $dwim, '', - 'Multiple selectors from hashref (via replace_content)'; + 'Hashref selectors (via replace_content)'; } { @@ -323,7 +323,23 @@ sub code_stream (&) { 'li.bar' => [ class => 'qux' ], })->to_html; is $dwim, '', - 'Multiple selectors from hashref (via set_attribute)'; + 'Hashref selectors (via set_attribute)'; +} + +{ + ok my $dwim = HTML::Zoom + ->from_html(q[]) + ->select('ul')->collect({ + passthrough => 1, + filter => sub { + $_->set_attribute({ + 'li.foo' => [ class => 'baz' ], + 'li.bar' => [ class => 'qux' ], + }); + } + })->to_html; + is $dwim, '', + 'Hashref selectors on codestream'; } done_testing;