1
0
Fork 0

Adding upstream version 0.8.9.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-22 10:16:14 +02:00
parent 3b2c48b5e4
commit c0c4addb85
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
285 changed files with 25880 additions and 0 deletions

View file

@ -0,0 +1,32 @@
package format_test
import (
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/nicholas-fedor/shoutrrr/pkg/format"
)
var _ = ginkgo.Describe("URLPart", func() {
ginkgo.It("should return the expected URL part for each lookup key", func() {
gomega.Expect(format.ParseURLPart("user")).To(gomega.Equal(format.URLUser))
gomega.Expect(format.ParseURLPart("pass")).To(gomega.Equal(format.URLPassword))
gomega.Expect(format.ParseURLPart("password")).To(gomega.Equal(format.URLPassword))
gomega.Expect(format.ParseURLPart("host")).To(gomega.Equal(format.URLHost))
gomega.Expect(format.ParseURLPart("port")).To(gomega.Equal(format.URLPort))
gomega.Expect(format.ParseURLPart("path")).To(gomega.Equal(format.URLPath))
gomega.Expect(format.ParseURLPart("path1")).To(gomega.Equal(format.URLPath))
gomega.Expect(format.ParseURLPart("path2")).To(gomega.Equal(format.URLPath + 1))
gomega.Expect(format.ParseURLPart("path3")).To(gomega.Equal(format.URLPath + 2))
gomega.Expect(format.ParseURLPart("path4")).To(gomega.Equal(format.URLPath + 3))
gomega.Expect(format.ParseURLPart("query")).To(gomega.Equal(format.URLQuery))
gomega.Expect(format.ParseURLPart("")).To(gomega.Equal(format.URLQuery))
})
ginkgo.It("should return the expected suffix for each URL part", func() {
gomega.Expect(format.URLUser.Suffix()).To(gomega.Equal(':'))
gomega.Expect(format.URLPassword.Suffix()).To(gomega.Equal('@'))
gomega.Expect(format.URLHost.Suffix()).To(gomega.Equal(':'))
gomega.Expect(format.URLPort.Suffix()).To(gomega.Equal('/'))
gomega.Expect(format.URLPath.Suffix()).To(gomega.Equal('/'))
})
})