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=bf23e788f027c454711a8421b44945acbb2443b8;hpb=4a3cf69401f1cdba7219cc23ede458c2615bbd7a 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' ); +} +