Yasuhiro Matsumoto 8 éve
szülő
commit
f96a447011
1 módosított fájl, 15 hozzáadás és 0 törlés
  1. 15 0
      colorable_test.go

+ 15 - 0
colorable_test.go

@@ -48,6 +48,21 @@ func TestNonColorable(t *testing.T) {
 	}
 }
 
+func TestNonColorableNil(t *testing.T) {
+	paniced := false
+	func() {
+		defer func() {
+			recover()
+			paniced = true
+		}()
+		NewNonColorable(nil)
+	}()
+
+	if !paniced {
+		t.Fatalf("should panic")
+	}
+}
+
 func TestColorable(t *testing.T) {
 	if runtime.GOOS == "windows" {
 		t.Skipf("skip this test on windows")