From 8019e6774408f0ef24753bccba660ae36ff4038d Mon Sep 17 00:00:00 2001 From: Julien Laffaye Date: Sat, 26 Jan 2019 09:10:51 +0100 Subject: [PATCH] Add tests for StatusText --- status_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 status_test.go diff --git a/status_test.go b/status_test.go new file mode 100644 index 0000000..1b04aa7 --- /dev/null +++ b/status_test.go @@ -0,0 +1,17 @@ +package ftp + +import "testing" + +func TestValidStatusText(t *testing.T) { + txt := StatusText(StatusInvalidCredentials) + if txt == "" { + t.Fatal("exptected status text, got empty string") + } +} + +func TestInvalidStatusText(t *testing.T) { + txt := StatusText(0) + if txt != "" { + t.Fatalf("got status text %q, expected empty string", txt) + } +}