-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get most used language for repo (#133)
* feature: add helper methods for the Set * add better lint support
- Loading branch information
Mark deVilliers
committed
Jun 6, 2023
1 parent
5a786e6
commit 8222a81
Showing
4 changed files
with
77 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package util | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_Set(t *testing.T) { | ||
|
||
s := NewSet[string]() | ||
s.AddWithValue("foo", 123) | ||
s.AddWithValue("bar", 456) | ||
s.AddWithValue("bar", 1) | ||
|
||
v, n := s.TopValue() | ||
|
||
require.Equal(t, 457, n) | ||
require.Equal(t, "bar", v) | ||
|
||
} |