X-Git-Url: http://erislabs.net/gitweb/?p=liburi-template-perl.git;a=blobdiff_plain;f=t%2F10-basic.t;fp=t%2F10-basic.t;h=70514c700a4884fffb1e5bd638d5441cf103e920;hp=c7b57c3b517a78fc250429df33c566499f22c0a1;hb=4a3cf69401f1cdba7219cc23ede458c2615bbd7a;hpb=d90743b3b3da9f8da1dd76e925b5e6284361837b diff --git a/t/10-basic.t b/t/10-basic.t index c7b57c3..70514c7 100644 --- a/t/10-basic.t +++ b/t/10-basic.t @@ -58,20 +58,20 @@ use_ok( 'URI::Template' ); } { - my $text = 'http://foo.com/{bar}/{baz}?q=%7B'; + my $text = 'http://foo.com/{bar}/{baz}?{foo}=%7B&{abr}=1'; my $template = URI::Template->new( $text ); isa_ok( $template, 'URI::Template' ); - is_deeply( [ sort $template->variables ], [ 'bar', 'baz' ], 'variables()' ); + is_deeply( [ $template->variables ], [ 'bar', 'baz', 'foo', 'abr' ], 'variables() in order of appearance' ); is( "$template", $text, 'stringify' ); { - my $result = $template->process( bar => 'x', baz => 'y' ); - is( $result, 'http://foo.com/x/y?q=%7B', 'process()' ); + my $result = $template->process( bar => 'x', baz => 'y', foo => 'b', abr => 'a' ); + is( $result, 'http://foo.com/x/y?b=%7B&a=1', 'process()' ); isa_ok( $result, 'URI', 'return value from process() isa URI' ); } { - my $result = $template->process_to_string( bar => 'x', baz => 'y' ); - is( $result, 'http://foo.com/x/y?q=%7B', 'process_to_string()' ); + my $result = $template->process_to_string( bar => 'x', baz => 'y', foo => 'b', abr => 'a' ); + is( $result, 'http://foo.com/x/y?b=%7B&a=1', 'process_to_string()' ); ok( !ref $result, 'result is not a ref' ); } }