automatic-mouse-mover/pkg/mousemover/mouseMover_test.go
Prashant Gupta dd073ccc11 using go mod
2019-03-26 19:50:09 -07:00

21 lines
417 B
Go

package mousemover
import (
"fmt"
"math"
"testing"
"github.com/go-vgo/robotgo"
"github.com/stretchr/testify/assert"
)
func TestMouseMove(t *testing.T) {
fmt.Println("starting test")
movePixel := 10
currentX, _ := robotgo.GetMousePos()
commCh := make(chan bool, 1)
moveMouse(movePixel, commCh)
movedX, _ := robotgo.GetMousePos()
assert.Equal(t, float64(movePixel), math.Abs(float64(movedX-currentX)))
}