Imported Upstream version 0.22
[liburi-template-perl.git] / t / gh-4.t
1 use strict;
2 use warnings;
3
4 use Test::More tests => 4;
5
6 use_ok( 'URI::Template' );
7
8 # variables w/ context
9 {
10     my $text     = 'http://foo.com/{bar}/{baz}?{foo}=%7B&{abr}=1';
11     my $template = URI::Template->new( $text );
12     isa_ok( $template, 'URI::Template' );
13     my @l_vars = $template->variables;
14     is_deeply( \@l_vars, [ 'bar', 'baz', 'foo', 'abr' ], 'variables() in list context' );
15     my $s_vars = $template->variables;
16     is( $s_vars, 4, 'variables() in scalar context' );
17 }
18