X-Git-Url: http://erislabs.net/gitweb/?p=liburi-template-perl.git;a=blobdiff_plain;f=t%2Fgh-4.t;fp=t%2Fgh-4.t;h=a0b5e662c83dc25da2d35a5e5036afe5e79a2624;hp=0000000000000000000000000000000000000000;hb=fc9466752f05a9a897e009307dc89917562ceda3;hpb=0d7b4e5c78381a4f4cba91587225acbc359df175 diff --git a/t/gh-4.t b/t/gh-4.t new file mode 100644 index 0000000..a0b5e66 --- /dev/null +++ b/t/gh-4.t @@ -0,0 +1,18 @@ +use strict; +use warnings; + +use Test::More tests => 4; + +use_ok( 'URI::Template' ); + +# variables w/ context +{ + my $text = 'http://foo.com/{bar}/{baz}?{foo}=%7B&{abr}=1'; + my $template = URI::Template->new( $text ); + isa_ok( $template, 'URI::Template' ); + my @l_vars = $template->variables; + is_deeply( \@l_vars, [ 'bar', 'baz', 'foo', 'abr' ], 'variables() in list context' ); + my $s_vars = $template->variables; + is( $s_vars, 4, 'variables() in scalar context' ); +} +