diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-08 22:03:01 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-08 22:03:01 +0200 |
| commit | 0d1492291a3e20665d8a3a6b16d2eb4e13938cee (patch) | |
| tree | ec09f7d660403478d23841cf541bdfa7f33aa70f /internal/eventloop_error_handling_test.go | |
| parent | d84902555621cc10b16a9641274b088e495f3714 (diff) | |
tui: restore global filter stack and anchored matches
Diffstat (limited to 'internal/eventloop_error_handling_test.go')
| -rw-r--r-- | internal/eventloop_error_handling_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/internal/eventloop_error_handling_test.go b/internal/eventloop_error_handling_test.go index 7f2c572..e025343 100644 --- a/internal/eventloop_error_handling_test.go +++ b/internal/eventloop_error_handling_test.go @@ -144,3 +144,32 @@ func TestProcessRawEventMalformedKnownTypeDoesNotPanicAndNotifies(t *testing.T) t.Fatalf("expected warning notification") } } + +func TestTracepointEnteredMissingCommWithCommFilterNotifies(t *testing.T) { + el := mustNewEventLoop(t, eventLoopConfig{commFilter: "system"}) + warnings := make(chan string, 1) + el.warningCb = func(message string) { warnings <- message } + + _, enterRaw := makeEnterFdEvent(t, defaulTime, defaultPid, defaultTid, 20, types.SYS_ENTER_WRITE) + + defer func() { + if r := recover(); r != nil { + t.Fatalf("tracepointEntered panicked: %v", r) + } + }() + + el.tracepointEntered(types.NewFdEvent(enterRaw)) + + select { + case msg := <-warnings: + if msg == "" { + t.Fatalf("expected non-empty warning message") + } + default: + t.Fatalf("expected warning notification") + } + + if _, ok := el.enterEvs[defaultTid]; ok { + t.Fatalf("expected no enter event to be stored for tid %d", defaultTid) + } +} |
