Yasuhiro Matsumoto 8 년 전
부모
커밋
7ea6f3d32e
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  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)
 	}
 }