4 use Test::More tests => 9;
6 use_ok( 'URI::Template' );
9 my $text = 'http://foo.com/{arg2}/{arg1}';
10 my $template = URI::Template->new( $text );
11 isa_ok( $template, 'URI::Template' );
13 [ $template->all_variables ],
19 my $result = $template->process( [ qw( x y ) ] );
20 is( $result, 'http://foo.com/x/y', 'process(\@args)' );
21 isa_ok( $result, 'URI', 'return value from process() isa URI' );
25 my $result = $template->process_to_string( [ qw( x y ) ] );
26 is( $result, 'http://foo.com/x/y', 'process_to_string(\@args)' );
27 ok( !ref $result, 'result is not a ref' );
32 my $result = $template->process_to_string( [ qw( 0 0 ) ] );
33 is( $result, 'http://foo.com/0/0', 'process w/ 0' );
38 my $result = $template->process_to_string( [] );
39 is( $result, 'http://foo.com//', 'process w/ no values' );