From 53a882d7fdfe3c4ff6d7b3859b9e3422f51509b1 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Sun, 24 Nov 2019 07:28:38 -0400 Subject: [PATCH] add drag mouse test code --- robotgo_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/robotgo_test.go b/robotgo_test.go index 19b5251..d3954f2 100644 --- a/robotgo_test.go +++ b/robotgo_test.go @@ -29,7 +29,7 @@ func TestGetVer(t *testing.T) { func TestMoveMouse(t *testing.T) { MoveMouse(10, 10) - Sleep(1) + MilliSleep(10) x, y := GetMousePos() tt.Equal(t, 10, x) @@ -38,9 +38,18 @@ func TestMoveMouse(t *testing.T) { func TestMoveMouseSmooth(t *testing.T) { MoveMouseSmooth(100, 100) - Sleep(1) + MilliSleep(10) x, y := GetMousePos() tt.Equal(t, 100, x) tt.Equal(t, 100, y) } + +func TestDragMouse(t *testing.T) { + DragMouse(20, 20) + MilliSleep(10) + x, y := GetMousePos() + + tt.Equal(t, 20, x) + tt.Equal(t, 20, y) +}