redis/extra/rediscmd/rediscmd_test.go

33 lines
687 B
Go
Raw Normal View History

2020-10-21 15:19:27 +03:00
package rediscmd
import (
"testing"
2023-01-27 18:00:49 +03:00
. "github.com/bsm/ginkgo/v2"
. "github.com/bsm/ginkgo/v2/extensions/table"
. "github.com/bsm/gomega"
2020-10-21 15:19:27 +03:00
)
func TestGinkgo(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "redisext")
}
var _ = Describe("AppendArg", func() {
DescribeTable("...",
func(src string, wanted string) {
b := appendArg(nil, src)
Expect(string(b)).To(Equal(wanted))
},
Entry("", "-inf", "-inf"),
Entry("", "+inf", "+inf"),
Entry("", "foo.bar", "foo.bar"),
Entry("", "foo:bar", "foo:bar"),
Entry("", "foo{bar}", "foo{bar}"),
Entry("", "foo-123_BAR", "foo-123_BAR"),
Entry("", "foo\nbar", "666f6f0a626172"),
Entry("", "\000", "00"),
)
})