Last active
December 24, 2022 05:29
-
-
Save metarsit/9cd951f7f9547d02d908ade2827a2ba2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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