From b899e60d5c5004525d9a554d1d5074d062c3fb95 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 7 Apr 2025 16:41:09 +0200 Subject: pkg/html: split off URL helpers The existing pkg/html package transitively takes too many dependencies, which complicates the reuse of some of its methods. Split off a pkg/html/urlutil package. --- pkg/html/html_test.go | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 pkg/html/html_test.go (limited to 'pkg/html/html_test.go') diff --git a/pkg/html/html_test.go b/pkg/html/html_test.go deleted file mode 100644 index d824e0246..000000000 --- a/pkg/html/html_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -package html - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestDropParam(t *testing.T) { - tests := []struct { - in string - key string - value string - out string - }{ - { - in: `/upstream?first=a&second=b`, - key: `first`, - value: ``, - out: `/upstream?second=b`, - }, - { - in: `/upstream?first=a&first=b&second=c`, - key: `second`, - value: ``, - out: `/upstream?first=a&first=b`, - }, - { - in: `/upstream?first=a&first=b&second=c`, - key: `first`, - value: ``, - out: `/upstream?second=c`, - }, - { - in: `/upstream?first=a&first=b&second=c`, - key: `first`, - value: `b`, - out: `/upstream?first=a&second=c`, - }, - } - - for _, test := range tests { - got := DropParam(test.in, test.key, test.value) - assert.Equal(t, test.out, got) - } -} -- cgit mrf-deployment