mirror of
https://github.com/donl/bimap.git
synced 2026-06-30 06:12:04 -06:00
Add test
This commit is contained in:
parent
904c668ed3
commit
bf8bc75073
1 changed files with 14 additions and 0 deletions
|
|
@ -140,6 +140,20 @@ func TestBiMap_InverseDelete(t *testing.T) {
|
|||
assert.Equal(t, expected, *actual, "They should be the same")
|
||||
}
|
||||
|
||||
func TestBiMap_WithVaryingType(t *testing.T) {
|
||||
actual := NewBiMap()
|
||||
dummyKey := "Dummy key"
|
||||
dummyVal := 3
|
||||
|
||||
actual.Insert(dummyKey, dummyVal)
|
||||
|
||||
res, _ := actual.Get(dummyKey)
|
||||
resVal, _ := actual.InverseGet(dummyVal)
|
||||
assert.Equal(t, dummyVal, res, "Get by string key should return integer val")
|
||||
assert.Equal(t, dummyKey, resVal, "Get by integer val should return string key")
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue