[Bps-public-commit] Path-Dispatcher branch, master, updated. 2b4ed8571a0a331378b603b659cb749974672dbd

sartak at bestpractical.com sartak at bestpractical.com
Fri Apr 17 03:16:44 EDT 2009


The branch, master has been updated
       via  2b4ed8571a0a331378b603b659cb749974672dbd (commit)
      from  f820221abc60f34842bb6d88d9c3ea0c66ed5062 (commit)

Summary of changes:
 t/022-numbers-undef.t |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 t/022-numbers-undef.t

- Log -----------------------------------------------------------------
commit 2b4ed8571a0a331378b603b659cb749974672dbd
Author: Shawn M Moore <sartak at gmail.com>
Date:   Fri Apr 17 03:16:18 2009 -0400

    Failing test for not preserving undef in run_with_number_vars

diff --git a/t/022-numbers-undef.t b/t/022-numbers-undef.t
new file mode 100644
index 0000000..d4eff58
--- /dev/null
+++ b/t/022-numbers-undef.t
@@ -0,0 +1,20 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 2;
+use Path::Dispatcher;
+
+my @recaptures;
+my $rule = Path::Dispatcher::Rule::Regex->new(
+    regex => qr/^(foo)(bar)?(baz)$/,
+    block => sub {
+        push @recaptures, $1, $2, $3;
+    },
+);
+
+my $match = $rule->match(Path::Dispatcher::Path->new("foobaz"));
+is_deeply($match->result, ['foo', undef, 'baz']);
+
+$match->run;
+is_deeply(\@recaptures, ['foo', undef, 'baz']);
+

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list