Merge tag 'upstream/0.22'
[liburi-template-perl.git] / t / gh-4.t
diff --git a/t/gh-4.t b/t/gh-4.t
new file mode 100644 (file)
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' );
+}
+