Skip to content

Instantly share code, notes, and snippets.

@metarsit
Created November 17, 2022 01:07
Show Gist options
  • Select an option

  • Save metarsit/0c4e5eb4173b67e326514ba16e41f68d to your computer and use it in GitHub Desktop.

Select an option

Save metarsit/0c4e5eb4173b67e326514ba16e41f68d to your computer and use it in GitHub Desktop.
var tcs = GenerateTestCasesForEqual(100000)
func TestEqualA(t *testing.T) {
for i, tc := range tcs {
t.Run(fmt.Sprintf("Test Case %d", i+1), func(t *testing.T) {
result := Equal(tc.a, tc.b)
if result != tc.expect {
t.Fatalf("test case number %d failed", i)
}
})
}
}
func TestEqualB(t *testing.T) {
for i, tc := range tcs {
t.Run(fmt.Sprintf("Test Case %d", i+1), func(t *testing.T) {
result := Equal(tc.a, tc.b)
if result != tc.expect {
t.Fatalf("test case number %d failed", i)
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment