Skip to content

Commit

Permalink
Update go.mod and add Unit Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nv7-GitHub committed Mar 22, 2021
1 parent afaf4b7 commit 34bb291
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/Nv7-Github/screenshot
module github.com/kbinani/screenshot

go 1.16

Expand Down
24 changes: 24 additions & 0 deletions screenshot_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package screenshot

import (
"testing"
)

func TestCaptureRect(t *testing.T) {
bounds := GetDisplayBounds(0)
_, err := CaptureRect(bounds)
if err != nil {
t.Error(err)
}
}

func BenchmarkCaptureRect(t *testing.B) {
bounds := GetDisplayBounds(0)
t.ResetTimer()
for i := 0; i < t.N; i++ {
_, err := CaptureRect(bounds)
if err != nil {
t.Error(err)
}
}
}

0 comments on commit 34bb291

Please sign in to comment.