瀏覽代碼

test: add more tests (#1352)

Kevin Wan 3 年之前
父節點
當前提交
26101732d2
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      rest/pathvar/params_test.go

+ 1 - 2
rest/pathvar/params_test.go

@@ -1,7 +1,6 @@
 package pathvar
 
 import (
-	"context"
 	"net/http"
 	"strings"
 	"testing"
@@ -16,7 +15,7 @@ func TestVars(t *testing.T) {
 	}
 	r, err := http.NewRequest(http.MethodGet, "/", nil)
 	assert.Nil(t, err)
-	r = r.WithContext(context.WithValue(context.Background(), pathVars, expect))
+	r = WithVars(r, expect)
 	assert.EqualValues(t, expect, Vars(r))
 }