You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
452 B
Go

6 months ago
package clipboard
import (
"fmt"
"testing"
6 months ago
"time"
6 months ago
)
func TestGet(t *testing.T) {
6 months ago
lsn, err := Listen()
6 months ago
if err != nil {
6 months ago
t.Fatal(err)
}
for {
select {
case cb := <-lsn:
fmt.Println(cb.plateform)
fmt.Println(cb.AvailableTypes())
fmt.Println(cb.Text())
fmt.Println(cb.HTML())
case <-time.After(60 * time.Second):
fmt.Println("not get clipboard data in 60s")
StopListen()
time.Sleep(time.Second * 15)
return
}
6 months ago
}
}