public function testRouteMatchingWithEmptyTrailingParams() {
$route = new Route(array('template' => '/{:controller}/{:action}/{:args}'));
$result = $route->match(array('controller' => 'posts'));
$this->assertEqual('/posts', $result);
$result = $route->match(array('controller' => 'posts', 'args' => 'foo'));
$this->assertEqual('/posts/index/foo', $result);
$result = $route->match(array('controller' => 'posts', 'args' => array('foo', 'bar')));
$this->assertEqual('/posts/index/foo/bar', $result);
$request = new Request();
$request->url = '/posts/index/foo/bar';
$result = $route->parse($request);
$expected = array(
'controller' => 'posts', 'action' => 'index', 'args' => array('foo', 'bar')
);
$this->assertEqual($expected, $result->params);
}