From 802610d858997785c923a2c3f258fa27923aee97 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Sat, 6 Apr 2024 11:08:47 +1100 Subject: [PATCH] feat: add IgnoreGoStringer() --- assert.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assert.go b/assert.go index be0e4cc..b352428 100644 --- a/assert.go +++ b/assert.go @@ -32,6 +32,13 @@ func OmitEmpty() CompareOption { } } +// IgnoreGoStringer ignores GoStringer implementations when comparing. +func IgnoreGoStringer() CompareOption { + return func() []repr.Option { + return []repr.Option{repr.IgnoreGoStringer()} + } +} + // Compare two values for equality and return true or false. func Compare[T any](t testing.TB, x, y T, options ...CompareOption) bool { return objectsAreEqual(x, y, options...)