use strict; use warnings FATAL => 'all'; use Test::More tests => 10; use Data::Dumper; BEGIN { use_ok('HTML::Tested', "HTV"); use_ok('HTML::Tested::Test'); use_ok('HTML::Tested::Value::DropDown'); } package T; use base 'HTML::Tested'; __PACKAGE__->ht_add_widget(::HTV."::DropDown", 'v'); package main; my $object = T->new({ v => [ [ 1, 'a', ], [ 2, 'b', ], ] }); is_deeply($object->v, [ [ 1, 'a', ], [ 2, 'b', ], ]); my $stash = {}; $object->ht_render($stash); is_deeply($stash, { v => < ENDS is_deeply($object->v, [ [ 1, 'a', ], [ 2, 'b', ], ]); push @{ $object->v->[1] }, 1; is_deeply($object->v, [ [ 1, 'a', ], [ 2, 'b', 1, ], ]); $object->ht_render($stash); is_deeply($stash, { v => < ENDS is_deeply($object->v, [ [ 1, 'a', ], [ 2, 'b', 1, ], ]); $object->v->[1]->[1] = 'b<'; $object->ht_render($stash); is_deeply($stash, { v => < ENDS