aboutsummaryrefslogtreecommitdiff
path: root/pathrouter/pathrouter_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pathrouter/pathrouter_test.go')
-rw-r--r--pathrouter/pathrouter_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pathrouter/pathrouter_test.go b/pathrouter/pathrouter_test.go
index 54108ac..96083ed 100644
--- a/pathrouter/pathrouter_test.go
+++ b/pathrouter/pathrouter_test.go
@@ -19,10 +19,10 @@ import (
func TestRouting(t *testing.T) {
// helper methods
varRx := regexp.MustCompile(`\$\w+`)
- h := func(status int, msgBase string) func(w http.ResponseWriter, r *http.Request, vars map[string]string) {
- return func(w http.ResponseWriter, r *http.Request, vars map[string]string) {
+ h := func(status int, msgBase string) pr.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request, rc pr.Context) {
msg := varRx.ReplaceAllStringFunc(msgBase, func(match string) string {
- return vars[strings.TrimPrefix(match, "$")]
+ return rc.Variable(strings.TrimPrefix(match, "$"))
})
if r.Method == http.MethodHead {
w.WriteHeader(status)