Debian Codegraph @

screenshot_test.go

raw
1 package screenshot
2
3 import (
4 "testing"
5 )
6
7 func TestCaptureRect(t *testing.T) {
8 bounds := GetDisplayBounds(0)
9 _, err := CaptureRect(bounds)
10 if err != nil {
11 t.Error(err)
12 }
13 }
14
15 func BenchmarkCaptureRect(t *testing.B) {
16 bounds := GetDisplayBounds(0)
17 t.ResetTimer()
18 for i := 0; i < t.N; i++ {
19 _, err := CaptureRect(bounds)
20 if err != nil {
21 t.Error(err)
22 }
23 }
24 }