File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 3333 - uses : actions/setup-go@v2
3434 with :
3535 stable : ' false'
36- go-version : ' 1.16.0-rc1 '
36+ go-version : ' 1.16.0'
3737
3838 - name : TestLinux
3939 run : |
Original file line number Diff line number Diff line change @@ -99,6 +99,26 @@ func TestClipboardMultipleWrites(t *testing.T) {
9999 }
100100}
101101
102+ func TestClipboardConcurrentRead (t * testing.T ) {
103+ // This test check that concurrent read/write to the clipboard does
104+ // not cause crashes on some specific platform, such as macOS.
105+ done := make (chan bool , 2 )
106+ go func () {
107+ defer func () {
108+ done <- true
109+ }()
110+ clipboard .Read (clipboard .FmtText )
111+ }()
112+ go func () {
113+ defer func () {
114+ done <- true
115+ }()
116+ clipboard .Read (clipboard .FmtImage )
117+ }()
118+ <- done
119+ <- done
120+ }
121+
102122func BenchmarkClipboard (b * testing.B ) {
103123
104124 b .Run ("text" , func (b * testing.B ) {
You can’t perform that action at this time.
0 commit comments