Permalink
Browse files

possibly fixed a path pattern compilaction bug, added a commented spe…

…c for :name(.:format)?

(see https://gist.github.com/2154980#gistcomment-169469 on the second part)
  • Loading branch information...
1 parent 6404e3d commit 31d640a5b302e5632035781ee831ff980790daa3 @floere committed Mar 23, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 test/compile_test.rb
View
@@ -83,15 +83,21 @@ 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"]]
]],
["/:user@?:host?", %r{\A/([^@%40/?#]+)(?:@|%40)?([^@%40/?#]+)?\z}, [
["/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|

0 comments on commit 31d640a

Please sign in to comment.