Yasuhiro Matsumoto 8 anni fa
parent
commit
7ea6f3d32e
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      colorable_test.go

+ 8 - 1
colorable_test.go

@@ -37,7 +37,14 @@ func TestNonColorable(t *testing.T) {
 	NewNonColorable(&buf).Write([]byte("\x1b[0m" + want + "\x1b[2J"))
 	got := buf.String()
 	if got != "hello" {
-		t.Fatalf("want %q but %q", "hello", got)
+		t.Fatalf("want %q but %q", want, got)
+	}
+
+	buf.Reset()
+	NewNonColorable(&buf).Write([]byte("\x1b["))
+	got = buf.String()
+	if got != "" {
+		t.Fatalf("want %q but %q", "", got)
 	}
 }