From bf8bc750735b30eb8ff3def9eb46824e074990cc Mon Sep 17 00:00:00 2001 From: Vishal Kuo Date: Thu, 10 Nov 2016 22:03:47 -0500 Subject: [PATCH] Add test --- bimap_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bimap_test.go b/bimap_test.go index 3b399b9..c4dd8a3 100644 --- a/bimap_test.go +++ b/bimap_test.go @@ -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") + +} +