@@ -22,14 +22,14 @@ func TestClipboard(t *testing.T) {
2222 if err != nil {
2323 t .Fatalf ("failed to read gold file: %v" , err )
2424 }
25- clipboard .Write (clipboard .MIMEImage , data )
25+ clipboard .Write (clipboard .FmtImage , data )
2626
27- b := clipboard .Read (clipboard .MIMEText )
27+ b := clipboard .Read (clipboard .FmtText )
2828 if b != nil {
2929 t .Fatalf ("read clipboard that stores image data as text should fail, but got len: %d" , len (b ))
3030 }
3131
32- b = clipboard .Read (clipboard .MIMEImage )
32+ b = clipboard .Read (clipboard .FmtImage )
3333 if b == nil {
3434 t .Fatalf ("read clipboard that stores image data as image should success, but got: nil" )
3535 }
@@ -41,13 +41,13 @@ func TestClipboard(t *testing.T) {
4141
4242 t .Run ("text" , func (t * testing.T ) {
4343 data := []byte ("golang.design/x/clipboard" )
44- clipboard .Write (clipboard .MIMEText , data )
44+ clipboard .Write (clipboard .FmtText , data )
4545
46- b := clipboard .Read (clipboard .MIMEImage )
46+ b := clipboard .Read (clipboard .FmtImage )
4747 if b != nil {
4848 t .Fatalf ("read clipboard that stores text data as image should fail, but got len: %d" , len (b ))
4949 }
50- b = clipboard .Read (clipboard .MIMEText )
50+ b = clipboard .Read (clipboard .FmtText )
5151 if b == nil {
5252 t .Fatal ("read clipboard taht stores text data as text should success, but got: nil" )
5353 }
@@ -63,10 +63,10 @@ func TestClipboardMultipleWrites(t *testing.T) {
6363 if err != nil {
6464 t .Fatalf ("failed to read gold file: %v" , err )
6565 }
66- chg := clipboard .Write (clipboard .MIMEImage , data )
66+ chg := clipboard .Write (clipboard .FmtImage , data )
6767
6868 data = []byte ("golang.design/x/clipboard" )
69- clipboard .Write (clipboard .MIMEText , data )
69+ clipboard .Write (clipboard .FmtText , data )
7070
7171 ctx , cancel := context .WithTimeout (context .Background (), time .Second * 2 )
7272 defer cancel ()
@@ -84,12 +84,12 @@ func TestClipboardMultipleWrites(t *testing.T) {
8484 t .Fatalf ("changed channel should be closed after receiving the notification" )
8585 }
8686
87- b := clipboard .Read (clipboard .MIMEImage )
87+ b := clipboard .Read (clipboard .FmtImage )
8888 if b != nil {
8989 t .Fatalf ("read clipboard that should store text data as image should fail, but got: %d" , len (b ))
9090 }
9191
92- b = clipboard .Read (clipboard .MIMEText )
92+ b = clipboard .Read (clipboard .FmtText )
9393 if b == nil {
9494 t .Fatalf ("read clipboard that should store text data as text should success, got: nil" )
9595 }
@@ -107,8 +107,8 @@ func BenchmarkClipboard(b *testing.B) {
107107 b .ReportAllocs ()
108108 b .ResetTimer ()
109109 for i := 0 ; i < b .N ; i ++ {
110- clipboard .Write (clipboard .MIMEText , data )
111- _ = clipboard .Read (clipboard .MIMEText )
110+ clipboard .Write (clipboard .FmtText , data )
111+ _ = clipboard .Read (clipboard .FmtText )
112112 }
113113 })
114114}
0 commit comments