From 31d640a5b302e5632035781ee831ff980790daa3 Mon Sep 17 00:00:00 2001 From: Florian Hanke Date: Fri, 23 Mar 2012 15:38:21 +1100 Subject: [PATCH] possibly fixed a path pattern compilaction bug, added a commented spec for :name(.:format)? (see https://gist.github.com/2154980#gistcomment-169469 on the second part) --- test/compile_test.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/compile_test.rb b/test/compile_test.rb index ca5801be..13104c8e 100644 --- a/test/compile_test.rb +++ b/test/compile_test.rb @@ -83,7 +83,7 @@ class CompileTest < Test::Unit::TestCase ]], ["/:name.?:format?", %r{\A/([^\.%2E/?#]+)(?:\.|%2E)?([^\.%2E/?#]+)?\z}, [ ["/foo", ["foo", nil]], - ["/.bar", [".bar", nil]], + ["/.bar", nil], ["/foo.bar", ["foo", "bar"]], ["/foo%2Ebar", ["foo", "bar"]] ]], @@ -91,7 +91,13 @@ class CompileTest < Test::Unit::TestCase ["/foo@bar", ["foo", "bar"]], ["/foo.foo@bar", ["foo.foo", "bar"]], ["/foo@bar.bar", ["foo", "bar.bar"]] - ]] + ]], + # From https://gist.github.com/2154980#gistcomment-169469. + # + # ["/:name(.:format)?", %r{\A/([^\.%2E/?#]+)(?:\(|%28)(?:\.|%2E)([^\.%2E/?#]+)(?:\)|%29)?\z}, [ + # ["/foo", ["foo"]], + # ["/foo.bar", ["foo", "bar"]] + # ]] ].each do |pattern, regexp, examples_expectations| app = nil examples_expectations.each do |example, expected|