Reset master to testing content
This commit is contained in:
1 parent
0f2587b719
commit
42afa2a56c
1483 files changed
+145308
-938069
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"os/exec"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestNativeOCRClipboardCopy(t *testing.T) {
|
||||
if os.Getenv("CTHULHU_NATIVE_OCR_COPY") != "1" {
|
||||
t.Skip("requires a private X11 display and xclip")
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 4*time.Second)
|
||||
defer cancel()
|
||||
want := "é猫 OCR\nsecond line"
|
||||
if err := (xclipOCRCopier{}).Copy(ctx, want); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, err := exec.CommandContext(ctx, "xclip", "-selection", "clipboard", "-out").Output()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if string(got) != want {
|
||||
t.Fatalf("clipboard = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user