You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tree_test.go
    path of file: ./repos/bud/package/router/radix
    
    the code of the file until where you have to start completion: package radix_test

import (
	"io"
	"net/http"
	"net/http/httptest"
	"sort"
	"strings"
	"testing"

	"github.com/gitchander/perm
    
func TestOptional(t *testing.T) {
	okp(t, &test{
		inserts: []*insert{
			{route: "/:id?"},
			{route: "/users/:id.:format?"},
			{route: "/users/v:version?"},
			{route: "/flights/:from/:to?"},
		},
		requests: []*request{
			{path: "/", route: "/:id?"},
			{path: "/10", route: "/:id?", slots: `id=10`},
			{path: "/a", route: "/:id?", slots: `id=a`},

			{path: "/users/10", route: "/users/:id.:format?", slots: `id=10`},
			{path: "/users/10/", nomatch: true},
			{path: "/users/10.json", route: "/users/:id.:format?", slots: `format=json&id=10`},
			{path: "/users/10.rss", route: "/users/:id.:format?", slots: `format=rss&id=10`},
			{path: "/users/index.html", route: "/users/:id.:format?", slots: `format=html&id=index`},
			{path: "/users/ü.html", route: "/users/:id.:format?", slots: `format=html&id=ü`},
			{path: "/users/index.html/more", nomatch: true},

			{path: "/users", route: "/users/v:version?"},
			{path: "/users/", nomatch: true},
			{path: "/users/v10", route: "/users/v:version?", slots: `version=10`},
			{path: "/users/v1", route: "/users/v:version?", slots: `version=1`},

			{path: "/flights/Berlin", route: "/flights/:from/:to?", slots: `from=Berlin`},
			{path: "/flights/Berlin/", nomatch: true},
			{path: "/flights/Berlin/Madison", route: "/flights/:from/:to?", slots: `from=Berlin&to=Madison`},
		},
	})
	ok(t, &test{
		inserts: []*insert{
			{route: "/:id?"},
			{route: "/:a.:b?", err: `radix: ambiguous routes "/:a.:b?" and "/:id?"`},
			{route: "/x:id?"},
			{route: "/not/:last?/path", err: `route "/not/:last?/path": optional "?" must be at the end`},
			{route: "/slash/:last?/", err: `route "/slash/:last?/": optional "?" must be at the end`},
		},
	})
}