package kmp import ( "testing" "gotest.tools/v3/assert" "gotest.tools/v3/assert/cmp" ) // Common test case and running logic for basic comparison tests. type testCase struct { cmp cmp.Comparison success bool } // TODO(aw185176): We could assert on error/failure content if we passed a fake // testing.T to assert.Assert in order to capture the t.Log output func run(t *testing.T, tc testCase) { t.Helper() switch { case tc.success: assert.Assert(t, tc.cmp, "expected successful comparison") case tc.cmp().Success(): t.Fatal("expected unsuccessful comparison") } }