From e4b2eef8d87568b0a9e3d18433f74918348d5626 Mon Sep 17 00:00:00 2001 From: aeneasr Date: Mon, 15 Oct 2018 05:14:56 +0200 Subject: [PATCH] Add tests to urlx, corx, cmdx Signed-off-by: aeneasr --- cmdx/env_test.go | 10 ++++++++++ corsx/corsx_test.go | 9 +++++++++ urlx/join_test.go | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 cmdx/env_test.go create mode 100644 urlx/join_test.go diff --git a/cmdx/env_test.go b/cmdx/env_test.go new file mode 100644 index 00000000..1afade08 --- /dev/null +++ b/cmdx/env_test.go @@ -0,0 +1,10 @@ +package cmdx + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestEnvVarExamplesHelpMessage(t *testing.T) { + assert.NotEmpty(t, EnvVarExamplesHelpMessage("")) +} diff --git a/corsx/corsx_test.go b/corsx/corsx_test.go index 09a2a26e..822eb537 100644 --- a/corsx/corsx_test.go +++ b/corsx/corsx_test.go @@ -1 +1,10 @@ package corsx + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestHelpMessage(t *testing.T) { + assert.NotEmpty(t, HelpMessage()) +} diff --git a/urlx/join_test.go b/urlx/join_test.go new file mode 100644 index 00000000..9dc94f36 --- /dev/null +++ b/urlx/join_test.go @@ -0,0 +1,10 @@ +package urlx + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestJoin(t *testing.T) { + assert.EqualValues(t, "http://foo/bar/baz/bar", MustJoin("http://foo", "bar/", "/baz", "bar")) +}