summaryrefslogtreecommitdiff
path: root/pkg/test/test.go
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2020-12-16 18:03:08 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2020-12-16 18:03:08 +0300
commit6b76a30c04cb74dd9a759789f75bba2eea86a1fb (patch)
tree802dd014510e6d871a8faa32a4c3073ac8d86fa3 /pkg/test/test.go
parent6fed9dd0dd62718f78eca11e30a71c2712636fbd (diff)
add defer test
Diffstat (limited to 'pkg/test/test.go')
-rw-r--r--pkg/test/test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/test/test.go b/pkg/test/test.go
index 89722fd..44289c9 100644
--- a/pkg/test/test.go
+++ b/pkg/test/test.go
@@ -14,6 +14,8 @@ import (
"tunnel/pkg/server"
)
+const xData = "Hello, World!"
+
type env struct {
*testing.T
}
@@ -69,6 +71,14 @@ func (c *Client) Send(format string, args ...interface{}) string {
return r
}
+func (c *Client) Get(name string) string {
+ return c.Send("get %s", name)
+}
+
+func (c *Client) Set(name string, value interface{}) {
+ c.Exec("set %s %s", name, value)
+}
+
func (c *Client) Exec(format string, args ...interface{}) {
s := c.Send(format, args...)
if s != "" {