internal/screentest: ignore pointer fields in tests
Added pointer fields on chromedp structs to ignore list
for comparison tests to prevent test failures.
Change-Id: Iad8b781d50e15f0e548b439b520efe27aba0e017
Reviewed-on: https://go-review.googlesource.com/c/website/+/481480
Auto-Submit: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
diff --git a/internal/screentest/screentest_test.go b/internal/screentest/screentest_test.go
index 9c0c8fd..99d7b8e 100644
--- a/internal/screentest/screentest_test.go
+++ b/internal/screentest/screentest_test.go
@@ -180,13 +180,9 @@
}
if diff := cmp.Diff(tt.want, got,
cmp.AllowUnexported(testcase{}),
- cmpopts.IgnoreFields(testcase{}, "output"),
- cmp.Comparer(func(a, b chromedp.ActionFunc) bool {
- return fmt.Sprint(a) == fmt.Sprint(b)
- }),
- cmp.Comparer(func(a, b chromedp.Selector) bool {
- return fmt.Sprint(a) == fmt.Sprint(b)
- }),
+ cmpopts.IgnoreFields(testcase{}, "output", "tasks"),
+ cmp.AllowUnexported(chromedp.Selector{}),
+ cmpopts.IgnoreFields(chromedp.Selector{}, "by", "wait", "after"),
); diff != "" {
t.Errorf("readTests() mismatch (-want +got):\n%s", diff)
}