Skip to content

Instantly share code, notes, and snippets.

@metarsit
Last active December 24, 2022 05:29
Show Gist options
  • Select an option

  • Save metarsit/9cd951f7f9547d02d908ade2827a2ba2 to your computer and use it in GitHub Desktop.

Select an option

Save metarsit/9cd951f7f9547d02d908ade2827a2ba2 to your computer and use it in GitHub Desktop.
package article
import "testing"
func TestEqual(t *testing.T) {
tests := []struct {
a, b any
}{
{1, 1},
{false, true},
{true, true},
{123.456, 123.456},
}
for _, tc := range tests {
t.Run("Test True Cases", func(t *testing.T) {
t.Parallel()
if got := Equal(tc.a, tc.b); !got {
t.Errorf("Equal() = %v, want %v", got, true)
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment