diff options
Diffstat (limited to 'core/core_test.go')
-rw-r--r-- | core/core_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/core_test.go b/core/core_test.go index d3c2e2c..3184ef5 100644 --- a/core/core_test.go +++ b/core/core_test.go @@ -145,6 +145,7 @@ func TestNotifications(t *testing.T) { } func TestNilConnection(t *testing.T) { + RegisterTestingT(t) var conn *Connection ch, err := conn.NewAPIChannel() @@ -168,6 +169,21 @@ func TestDoubleConnection(t *testing.T) { Expect(conn).Should(BeNil()) } +func TestAsyncConnection(t *testing.T) { + ctx := setupTest(t) + defer ctx.teardownTest() + + ctx.conn.Disconnect() + conn, ch, err := AsyncConnect(ctx.mockVpp) + ctx.conn = conn + + Expect(err).ShouldNot(HaveOccurred()) + Expect(conn).ShouldNot(BeNil()) + + ev := <-ch + Expect(ev.State).Should(BeEquivalentTo(Connected)) +} + func TestFullBuffer(t *testing.T) { ctx := setupTest(t) defer ctx.teardownTest() |