瀏覽代碼

Add tests for StatusText

Julien Laffaye 6 年之前
父節點
當前提交
8019e67744
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      status_test.go

+ 17 - 0
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)
+	}
+}