From 0b69898abea7595f63fc3a66b3d9571d8853f6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Sat, 17 Feb 2024 21:20:47 +0800 Subject: [PATCH] test(event): Increase the proportion of unit tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Flcă‚› --- event/dispatcher_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/event/dispatcher_test.go b/event/dispatcher_test.go index 90bc7b71..bf62f358 100644 --- a/event/dispatcher_test.go +++ b/event/dispatcher_test.go @@ -95,3 +95,14 @@ func TestDispatcher(t *testing.T) { assert.Equal(t, Event("test3"), r4.event) assert.Equal(t, "test3 data", r4.data) } + +func TestEvent_String(t *testing.T) { + assert.Equal(t, "test", Event("test").String()) + assert.Equal(t, "test2", Event("test2").String()) +} + +func TestDefaultRecovery(t *testing.T) { + assert.NotPanics(t, func() { + DefaultRecovery("test", &testListener{}, "test", "test data") + }) +}